mirror of
https://github.com/laoxong/nofx.git
synced 2026-06-04 09:58:22 +08:00
Change SQLite driver in database configuration (#441)
* Change SQLite driver in database configuration Replace SQLite driver from 'github.com/mattn/go-sqlite3' to 'modernc.org/sqlite'. * Update go.mod --------- Co-authored-by: tinkle-community <tinklefund@gmail.com>
This commit is contained in:
+2
-2
@@ -13,7 +13,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
_ "modernc.org/sqlite"
|
||||
)
|
||||
|
||||
// Database 配置数据库
|
||||
@@ -23,7 +23,7 @@ type Database struct {
|
||||
|
||||
// NewDatabase 创建配置数据库
|
||||
func NewDatabase(dbPath string) (*Database, error) {
|
||||
db, err := sql.Open("sqlite3", dbPath)
|
||||
db, err := sql.Open("sqlite", dbPath)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("打开数据库失败: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user