kvdb: add sqlite

This commit is contained in:
Elle Mouton
2022-12-15 18:13:13 +02:00
parent 3d91bb65f7
commit 74b9c9ce9a
16 changed files with 374 additions and 10 deletions

View File

@ -275,6 +275,20 @@ func GetTestBackend(path, name string) (Backend, func(), error) {
)
return backend, cancel, err
case SqliteBackend:
dbPath := filepath.Join(path, name)
keyHash := sha256.Sum256([]byte(dbPath))
sqliteDb, err := StartSqliteTestBackend(
path, name, "test_"+hex.EncodeToString(keyHash[:]),
)
if err != nil {
return nil, empty, err
}
return sqliteDb, func() {
_ = sqliteDb.Close()
}, nil
default:
db, err := GetBoltBackend(&BoltBackendConfig{
DBPath: path,