InitTestFileDB initializes a file-based test database with the default schema.
(t *testing.T)
| 60 | |
| 61 | // InitTestFileDB initializes a file-based test database with the default schema. |
| 62 | func InitTestFileDB(t *testing.T) (*DB, string) { |
| 63 | uuid := mustGenerateTestUUID(t) |
| 64 | dbPath := filepath.Join(t.TempDir(), fmt.Sprintf("dnote-%s.db", uuid)) |
| 65 | db := InitTestFileDBRaw(t, dbPath) |
| 66 | return db, dbPath |
| 67 | } |
| 68 | |
| 69 | // InitTestFileDBRaw initializes a file-based test database at the specified path with the default schema. |
| 70 | func InitTestFileDBRaw(t *testing.T, dbPath string) *DB { |