Separate subprefix db export

This commit is contained in:
lash 2024-11-02 23:41:08 +00:00
parent 1d77ad98dc
commit dae12ac498
Signed by untrusted user who does not match committer: lash
GPG Key ID: 21D2E7BB88C2A746

View File

@ -2,12 +2,14 @@ package common
import (
"git.defalsify.org/vise.git/db"
"git.grassecon.net/urdt/ussd/internal/storage"
)
func StoreToDb(store *UserDataStore, prefix []byte) db.Db {
innerStore := store.Db
if pfx != nil {
innerStore = NewSubPrefixDb(innerStore, pfx)
}
return innerStore
func StoreToDb(store *UserDataStore) db.Db {
return store.Db
}
func StoreToPrefixDb(store *UserDataStore, pfx []byte) storage.PrefixDb {
return storage.NewSubPrefixDb(store.Db, pfx)
}