MCPcopy
hub / github.com/sqlc-dev/sqlc / SQLite

Function SQLite

internal/sqltest/sqlite.go:15–26  ·  view source on GitHub ↗
(t *testing.T, migrations []string)

Source from the content-addressed store, hash-verified

13)
14
15func SQLite(t *testing.T, migrations []string) (*sql.DB, func()) {
16 t.Helper()
17 // For each test, pick a new database name at random.
18 source, err := os.CreateTemp("", "sqltest_sqlite_")
19 if err != nil {
20 t.Fatal(err)
21 }
22 if err := source.Close(); err != nil {
23 t.Fatal(err)
24 }
25 return CreateSQLiteDatabase(t, source.Name(), migrations)
26}
27
28func CreateSQLiteDatabase(t *testing.T, path string, migrations []string) (*sql.DB, func()) {
29 t.Helper()

Callers 4

TestBooksFunction · 0.92
TestAuthorsFunction · 0.92
TestPreparedFunction · 0.92
TestQueriesFunction · 0.92

Calls 3

CreateSQLiteDatabaseFunction · 0.85
CloseMethod · 0.65
NameMethod · 0.65

Tested by 4

TestBooksFunction · 0.74
TestAuthorsFunction · 0.74
TestPreparedFunction · 0.74
TestQueriesFunction · 0.74