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

This commit is contained in:
TwiN
2022-08-11 20:47:29 -04:00
parent f01b66f083
commit 9de6334f21
6 changed files with 194 additions and 19 deletions

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,
},
}
}