MCPcopy Create free account
hub / github.com/sql-machine-learning/sqlflow / createSQLFSTestingDatabase

Function createSQLFSTestingDatabase

go/sqlfs/writer_test.go:35–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

33)
34
35func createSQLFSTestingDatabase() {
36 db := database.GetTestingDBSingleton()
37 if db.DriverName == "maxcompute" {
38 // maxcompute database is pre created
39 testDatabaseName = test.GetEnv("SQLFLOW_TEST_DB_MAXCOMPUTE_PROJECT", "test")
40 } else {
41 stmt := fmt.Sprintf("CREATE DATABASE IF NOT EXISTS %s;", testDatabaseName)
42 if _, e := db.Exec(stmt); e != nil {
43 log.Fatalf("Cannot create sqlfs testing database %s: %v", testDatabaseName, e)
44 }
45 }
46}
47
48func TestSQLFSWriterCreate(t *testing.T) {
49 createSQLFSTestingDatabaseOnce.Do(createSQLFSTestingDatabase)

Callers

nothing calls this directly

Calls 3

GetTestingDBSingletonFunction · 0.92
GetEnvFunction · 0.92
FatalfMethod · 0.80

Tested by

no test coverage detected