fix(docs/storage): resolve FLAW-02, remove unused docDir and update documentation for pure database architecture
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 39s

This commit is contained in:
sandrodach committed 2026-10-26 14:31:54 +01:00
1 parent 3480859d8a
commit 0bdeb5f320
7 files changed
+42 -52

No files matched your search

+1 -5
View File
@@ -21,19 +21,15 @@ import (
type Store struct {
db *sql.DB
docDir string
initMu sync.Mutex
}
func NewStore(dbPath string) (*Store, error) {
var docDir string
if dbPath != ":memory:" && !strings.HasPrefix(dbPath, "file:") {
dir := filepath.Dir(dbPath)
if err := os.MkdirAll(dir, 0755); err != nil {
return nil, fmt.Errorf("failed to create data directory %s: %w", dir, err)
}
docDir = filepath.Join(dir, "workspace")
_ = os.MkdirAll(docDir, 0755)
}
dsn := dbPath
@@ -49,7 +45,7 @@ func NewStore(dbPath string) (*Store, error) {
db.SetMaxOpenConns(8)
db.SetMaxIdleConns(4)
store := &Store{db: db, docDir: docDir}
store := &Store{db: db}
if err := store.migrate(); err != nil {
return nil, fmt.Errorf("failed to run migrations: %w", err)
}