MCPcopy Index your code
hub / github.com/dnote/dnote / InitDB

Function InitDB

pkg/server/testutils/main.go:41–46  ·  view source on GitHub ↗

InitDB opens a database at the given path and initializes the schema

(dbPath string)

Source from the content-addressed store, hash-verified

39
40// InitDB opens a database at the given path and initializes the schema
41func InitDB(dbPath string) *gorm.DB {
42 db := database.Open(dbPath)
43 database.InitSchema(db)
44 database.Migrate(db)
45 return db
46}
47
48// InitMemoryDB creates an in-memory SQLite database with the schema initialized
49func InitMemoryDB(t *testing.T) *gorm.DB {

Callers 4

TestUserCreateCmdFunction · 0.92
TestUserRemoveCmdFunction · 0.92
TestUserResetPasswordCmdFunction · 0.92
TestUserListCmdFunction · 0.92

Calls 3

OpenFunction · 0.92
InitSchemaFunction · 0.92
MigrateFunction · 0.92

Tested by 4

TestUserCreateCmdFunction · 0.74
TestUserRemoveCmdFunction · 0.74
TestUserResetPasswordCmdFunction · 0.74
TestUserListCmdFunction · 0.74