mirror of https://github.com/allinssl/allinssl
修改初始化sqlite库
parent
bd33e6f0be
commit
eaa5d10e28
|
@ -4,7 +4,7 @@ import (
|
||||||
"ALLinSSL/backend/public"
|
"ALLinSSL/backend/public"
|
||||||
"database/sql"
|
"database/sql"
|
||||||
"fmt"
|
"fmt"
|
||||||
_ "github.com/mattn/go-sqlite3"
|
_ "modernc.org/sqlite"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
)
|
)
|
||||||
|
@ -16,7 +16,7 @@ func init() {
|
||||||
_, _ = filepath.Abs(dbPath)
|
_, _ = filepath.Abs(dbPath)
|
||||||
os.WriteFile(dbPath, []byte{}, 0644)
|
os.WriteFile(dbPath, []byte{}, 0644)
|
||||||
// fmt.Println("数据库路径:", absPath)
|
// fmt.Println("数据库路径:", absPath)
|
||||||
db, err := sql.Open("sqlite3", dbPath)
|
db, err := sql.Open("sqlite", dbPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// fmt.Println("创建数据库失败:", err)
|
// fmt.Println("创建数据库失败:", err)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue