MCPcopy Create free account
hub / github.com/temporalio/temporal / LoadSchema

Function LoadSchema

common/persistence/tests/sqlite_test.go:77–92  ·  view source on GitHub ↗
(t *testing.T, db sqlplugin.AdminDB, schemaFile string)

Source from the content-addressed store, hash-verified

75}
76
77func LoadSchema(t *testing.T, db sqlplugin.AdminDB, schemaFile string) {
78 statements, err := persistence.LoadAndSplitQuery([]string{schemaFile})
79 if err != nil {
80 t.Fatalf("Unable to load schema: %s", err)
81 }
82
83 if rewriter, ok := db.(sqlplugin.SchemaStatementRewriter); ok {
84 statements = rewriter.RewriteSchemaStatements(statements)
85 }
86
87 for _, stmt := range statements {
88 if err = db.Exec(stmt); err != nil {
89 t.Fatalf("Unable to load schema: %s", err)
90 }
91 }
92}
93
94func TestSQLiteExecutionMutableStateStoreSuite(t *testing.T) {
95 t.Parallel()

Callers 1

SetupSQLiteDatabaseFunction · 0.85

Calls 4

LoadAndSplitQueryFunction · 0.92
FatalfMethod · 0.65
ExecMethod · 0.65

Tested by

no test coverage detected