InitDB opens a database at the given path and initializes the schema
(dbPath string)
| 39 | |
| 40 | // InitDB opens a database at the given path and initializes the schema |
| 41 | func 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 |
| 49 | func InitMemoryDB(t *testing.T) *gorm.DB { |