feat(db): enable sqlite for storing users

This commit is contained in:
hexxa 2022-08-31 22:30:24 +08:00 committed by Hexxa
parent f95a611204
commit 59a39efc4a
10 changed files with 791 additions and 59 deletions

View file

@ -2,6 +2,7 @@ package sqlite
import (
"database/sql"
"fmt"
_ "github.com/mattn/go-sqlite3"
"github.com/ihexxa/quickshare/src/db/rdb"
@ -13,7 +14,7 @@ type SQLite struct {
}
func NewSQLite(dbPath string) (*SQLite, error) {
db, err := sql.Open("sqlite3", dbPath)
db, err := sql.Open("sqlite3", fmt.Sprintf("%s?_synchronous=FULL", dbPath))
if err != nil {
return nil, err
}