2024-09-14 20:37:51 -05:00
|
|
|
package sqlite
|
|
|
|
|
|
|
|
|
|
import (
|
2024-10-28 13:48:22 -05:00
|
|
|
"codeberg.org/danjones000/combluotion/config"
|
|
|
|
|
"codeberg.org/danjones000/combluotion/store"
|
2024-09-14 20:37:51 -05:00
|
|
|
"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
|
|
|
|
|
}
|