GetTestingDBSingleton returns the testing DB singleton.
()
| 35 | |
| 36 | // GetTestingDBSingleton returns the testing DB singleton. |
| 37 | func GetTestingDBSingleton() *DB { |
| 38 | muTestingDBSingleton.Lock() |
| 39 | defer muTestingDBSingleton.Unlock() |
| 40 | |
| 41 | if testingDBSingleton == nil { |
| 42 | testingDBSingleton = createTestingDB() |
| 43 | } |
| 44 | return testingDBSingleton |
| 45 | } |
| 46 | |
| 47 | // createTestingDB opens a database with parameters specified in the |
| 48 | // environment variables with prefix name "SQLFLOW_TEST_DB". By |