Commit Graph
2 Commits
Author SHA1 Message Date
zhangwenjian 2ec6cbdde8 fix🐛: tell a default build how to get the sqlite3 driver
A default build does not include sqlite3, and a config that names it stopped
with "unsupported database driver "sqlite3", this build supports mysql,
postgres, sqlserver". That says what is missing but not what to do about it.

For sqlite3 specifically, say to rebuild with -tags sqlite3. The test runs
only in a build without the tag, and fails without the hint.
2026-10-02 09:47:13 +08:00
zhangwenjian d4cf11d313 fix🐛: report an unknown database driver instead of panicking
opens is a map, so opens[c.Driver] on a driver this build does not carry
returns a nil function, and gorm.Open calls it. The operator saw a nil
dereference inside gorm with nothing naming the driver.

sqlite3 is the case that bites: it needs cgo and is only compiled in
under the sqlite3 build tag, so the same config file works on one binary
and dies on another. Resolve the driver first and say which ones this
build supports.
2026-08-23 13:19:15 +08:00