Using squirrel to generalize SQL search

This commit is contained in:
Deluan
2020-01-13 15:28:55 -05:00
committed by Deluan Quintão
parent d3af7e689d
commit c2448d3880
10 changed files with 134 additions and 34 deletions
+3
View File
@@ -11,6 +11,8 @@ import (
_ "github.com/mattn/go-sqlite3"
)
const batchSize = 100
var once sync.Once
func Db() orm.Ormer {
@@ -66,6 +68,7 @@ func initORM(dbPath string) error {
orm.RegisterModel(new(Checksum))
orm.RegisterModel(new(Property))
orm.RegisterModel(new(Playlist))
orm.RegisterModel(new(Search))
err := orm.RegisterDataBase("default", "sqlite3", dbPath)
if err != nil {
panic(err)