MCPcopy Create free account
hub / github.com/cloudbase/garm / NewDatabase

Function NewDatabase

database/database.go:26–34  ·  view source on GitHub ↗
(ctx context.Context, cfg config.Database)

Source from the content-addressed store, hash-verified

24)
25
26func NewDatabase(ctx context.Context, cfg config.Database) (common.Store, error) {
27 dbBackend := cfg.DbBackend
28 switch dbBackend {
29 case config.MySQLBackend, config.SQLiteBackend:
30 return sql.NewSQLDatabase(ctx, cfg)
31 default:
32 return nil, fmt.Errorf("db backend not available: %s", dbBackend)
33 }
34}

Callers 12

SetupTestMethod · 0.92
SetupTestMethod · 0.92
SetupTestMethod · 0.92
SetupTestMethod · 0.92
SetupTestMethod · 0.92
SetupTestMethod · 0.92
SetupTestMethod · 0.92
SetupTestMethod · 0.92
SetupTestMethod · 0.92
SetupTestMethod · 0.92
TestWatcherTestSuiteFunction · 0.92
mainFunction · 0.92

Calls 1

NewSQLDatabaseFunction · 0.92

Tested by 11

SetupTestMethod · 0.74
SetupTestMethod · 0.74
SetupTestMethod · 0.74
SetupTestMethod · 0.74
SetupTestMethod · 0.74
SetupTestMethod · 0.74
SetupTestMethod · 0.74
SetupTestMethod · 0.74
SetupTestMethod · 0.74
SetupTestMethod · 0.74
TestWatcherTestSuiteFunction · 0.74