refactor: introduce store.Store graph interface with SQLite implementation

This commit is contained in:
2026-03-31 15:38:06 +02:00
parent d569a4dea9
commit ed9117951f
5 changed files with 740 additions and 524 deletions

View File

@@ -1,6 +1,9 @@
package service
import "axolotl/models"
import (
"axolotl/models"
"axolotl/store"
)
type NodeService interface {
Create(title, content, dueDate string, tags []string, rels map[models.RelType][]string) (*models.Node, error)
@@ -13,15 +16,15 @@ type NodeService interface {
}
func InitNodeService(path string) error {
return InitSqliteDB(path)
return store.InitSQLiteStore(path)
}
func GetNodeService(cfg Config) (NodeService, error) {
db, err := GetSqliteDB(cfg)
st, err := store.FindAndOpenSQLiteStore()
if err != nil {
return nil, err
}
return &sqliteNodeService{db: db, userID: cfg.GetUser()}, nil
return &nodeServiceImpl{store: st, userID: cfg.GetUser()}, nil
}
type listFilter struct {