mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-10-10 07:48:14 +00:00
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.
This commit is contained in:
@@ -17,6 +17,12 @@ import (
|
||||
func openerFor(driver string) (func(string) gorm.Dialector, error) {
|
||||
open, ok := opens[driver]
|
||||
if !ok {
|
||||
// sqlite3 is the driver people reach for first, and the one a default
|
||||
// build leaves out. Say how to get it rather than only what is missing.
|
||||
if driver == "sqlite3" {
|
||||
return nil, fmt.Errorf("database driver %q is not in this build, rebuild with -tags sqlite3 (this build supports %s)",
|
||||
driver, strings.Join(supportedDrivers(), ", "))
|
||||
}
|
||||
return nil, fmt.Errorf("unsupported database driver %q, this build supports %s",
|
||||
driver, strings.Join(supportedDrivers(), ", "))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user