feat(storage): Add optional write-through cache to sql store

This commit is contained in:
TwiN committed 2022-08-18 19:29:39 -04:00
1 parent f01b66f083
commit 9de6334f21
6 files changed
+194 -19

No files matched your search

+9 -1
View File
@@ -93,7 +93,11 @@ func initStoresAndBaseScenarios(t *testing.T, testName string) []*Scenario {
if err != nil {
t.Fatal("failed to create store:", err.Error())
}
sqliteStore, err := sql.NewStore("sqlite", t.TempDir()+"/"+testName+".db")
sqliteStore, err := sql.NewStore("sqlite", t.TempDir()+"/"+testName+".db", false)
if err != nil {
t.Fatal("failed to create store:", err.Error())
}
sqliteStoreWithCaching, err := sql.NewStore("sqlite", t.TempDir()+"/"+testName+"-with-caching.db", true)
if err != nil {
t.Fatal("failed to create store:", err.Error())
}
@@ -106,6 +110,10 @@ func initStoresAndBaseScenarios(t *testing.T, testName string) []*Scenario {
Name: "sqlite",
Store: sqliteStore,
},
{
Name: "sqlite-with-caching",
Store: sqliteStoreWithCaching,
},
}
}