feat: store/db module with sqlite

This commit is contained in:
boojack
2022-05-22 00:59:22 +08:00
parent c34cbb19bc
commit 8e01eb8702
19 changed files with 228 additions and 40 deletions

View File

@ -7,6 +7,7 @@ import (
"memos/common"
"memos/server"
"memos/store"
DB "memos/store/db"
)
const (
@ -25,14 +26,14 @@ type Main struct {
}
func (m *Main) Run() error {
db := store.NewDB(m.profile)
db := DB.NewDB(m.profile)
if err := db.Open(); err != nil {
return fmt.Errorf("cannot open db: %w", err)
}
s := server.NewServer(m.profile)
storeInstance := store.New(db)
storeInstance := store.New(db.Db, m.profile)
s.Store = storeInstance
if err := s.Run(); err != nil {