mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-10-08 23:28:56 +00:00
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.
21 lines
544 B
Go
21 lines
544 B
Go
//go:build !sqlite3
|
|
|
|
package database
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
// A default build has no sqlite3, and a config naming it is the usual first
|
|
// run. The error has to say how to get the driver, not only that it is missing.
|
|
func TestOpenerForTellsHowToGetSqliteInADefaultBuild(t *testing.T) {
|
|
_, err := openerFor("sqlite3")
|
|
if err == nil {
|
|
t.Fatal("sqlite3 was accepted by a build without the sqlite3 tag")
|
|
}
|
|
if !strings.Contains(err.Error(), "-tags sqlite3") {
|
|
t.Errorf("error does not say how to enable sqlite3: %s", err)
|
|
}
|
|
}
|