Switch from in-memory to SQLite storage

This commit is contained in:
bronku 2025-03-19 11:59:08 +01:00
parent e55ca30d20
commit 23647d74fc
6 changed files with 288 additions and 40 deletions

View file

@ -16,7 +16,8 @@ func main() {
log.Fatal("can't parse templates: ", err)
}
h.tmpl = templates
h.s = NewStore()
// #todo: error handling
h.s, _ = NewStore("./foo.db")
h.s.saveCake(cake{"Sernik ulubiony", -1, 65, 0})
h.s.saveCake(cake{"Malinowa chmurka", -1, 150, 0})