aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/dbx/db.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/dbx/db.go')
-rw-r--r--src/dbx/db.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/dbx/db.go b/src/dbx/db.go
index b839531..5ee3782 100644
--- a/src/dbx/db.go
+++ b/src/dbx/db.go
@@ -1,6 +1,7 @@
package dbx
import (
+ "context"
"fmt"
"io/fs"
"log"
@@ -20,6 +21,16 @@ var (
func Init(sqlDir fs.FS) {
db = sqlx.MustConnect("sqlite3", DBName)
atexit.Register(Close)
+
+ conn := Try2(db.Conn(context.Background()))
+ Try(conn.Raw(func(driverConn any) error {
+ return driverConn.(*sqlite3.SQLiteConn).RegisterFunc("C_",
+ func(s, _ string) string {
+ return s
+ }, true)
+ }))
+ conn.Close()
+
Try(applyMigrations(sqlDir))
/* TODO: Remove debug code */