mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-14 00:07:01 +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:
@@ -13,7 +13,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
_ "github.com/mattn/go-sqlite3"
|
_ "modernc.org/sqlite"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Database 配置数据库
|
// Database 配置数据库
|
||||||
@@ -23,7 +23,7 @@ type Database struct {
|
|||||||
|
|
||||||
// NewDatabase 创建配置数据库
|
// NewDatabase 创建配置数据库
|
||||||
func NewDatabase(dbPath string) (*Database, error) {
|
func NewDatabase(dbPath string) (*Database, error) {
|
||||||
db, err := sql.Open("sqlite3", dbPath)
|
db, err := sql.Open("sqlite", dbPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("打开数据库失败: %w", err)
|
return nil, fmt.Errorf("打开数据库失败: %w", err)
|
||||||
}
|
}
|
||||||
|
|||||||
2
go.mod
2
go.mod
@@ -10,7 +10,7 @@ require (
|
|||||||
github.com/golang-jwt/jwt/v5 v5.2.0
|
github.com/golang-jwt/jwt/v5 v5.2.0
|
||||||
github.com/google/uuid v1.6.0
|
github.com/google/uuid v1.6.0
|
||||||
github.com/gorilla/websocket v1.5.3
|
github.com/gorilla/websocket v1.5.3
|
||||||
github.com/mattn/go-sqlite3 v1.14.22
|
modernc.org/sqlite v1.40.0
|
||||||
github.com/pquerna/otp v1.4.0
|
github.com/pquerna/otp v1.4.0
|
||||||
github.com/sirupsen/logrus v1.9.3
|
github.com/sirupsen/logrus v1.9.3
|
||||||
github.com/sonirico/go-hyperliquid v0.17.0
|
github.com/sonirico/go-hyperliquid v0.17.0
|
||||||
|
|||||||
Reference in New Issue
Block a user