aboutsummaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorGabriel A. Giovanini <mail@gabrielgio.me>2024-04-20 21:07:51 +0200
committerGabriel A. Giovanini <mail@gabrielgio.me>2024-04-20 21:15:45 +0200
commita26f850c2372718d2b69d6b258d686c68ddba5ff (patch)
treeca45aa4a57ded8381d404804c4b07255fc01b563 /db
parent07f7f50fd5ff577896314984d1f365631be093bc (diff)
downloaddict-a26f850c2372718d2b69d6b258d686c68ddba5ff.tar.gz
dict-a26f850c2372718d2b69d6b258d686c68ddba5ff.tar.bz2
dict-a26f850c2372718d2b69d6b258d686c68ddba5ff.zip
ref: Better doc and makefile
It adds README explaining how to compile and install. Makefile allows to install dict system wide.
Diffstat (limited to 'db')
-rw-r--r--db/db.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/db/db.go b/db/db.go
index 61f3bb5..c3699d7 100644
--- a/db/db.go
+++ b/db/db.go
@@ -9,6 +9,8 @@ import (
"github.com/mattn/go-sqlite3"
)
+var LibPath = "ext/libsqlite3ext"
+
type (
DB struct {
db *sql.DB
@@ -24,7 +26,7 @@ type (
func Open(filename string) (*DB, error) {
sql.Register("sqlite3_with_extensions", &sqlite3.SQLiteDriver{
ConnectHook: func(conn *sqlite3.SQLiteConn) error {
- return conn.LoadExtension("ext/libsqlite3ext", "sqlite3_spellfix_init")
+ return conn.LoadExtension(LibPath, "sqlite3_spellfix_init")
},
})