✨ Improve Store
Still need to fill out SQLite bootstrap Also setup plug-in system mechanism
This commit is contained in:
parent
c4513aa94b
commit
e7b88bcc09
10 changed files with 154 additions and 6 deletions
29
store/sqlite/repo.go
Normal file
29
store/sqlite/repo.go
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
package sqlite
|
||||
|
||||
import (
|
||||
"codeberg.org/danjones000/lenore/config"
|
||||
"codeberg.org/danjones000/lenore/store"
|
||||
"github.com/go-ap/storage-sqlite"
|
||||
)
|
||||
|
||||
func init() {
|
||||
store.AddFactory("sqlite", MakeStore)
|
||||
}
|
||||
|
||||
func MakeStore(conf config.Config) (store.Store, error) {
|
||||
sqlConf := sqlite.Config{Path: conf.Conn.DSN}
|
||||
db, err := sqlite.New(sqlConf)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return Repo{db}, nil
|
||||
}
|
||||
|
||||
type Repo struct {
|
||||
store.PartStore
|
||||
}
|
||||
|
||||
func (r Repo) Bootstrap(config.Config) error {
|
||||
// @todo
|
||||
return nil
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue