Skip to content

Commit

Permalink
fix: use cgo sqlite (indes#193)
Browse files Browse the repository at this point in the history
  • Loading branch information
indes committed Sep 12, 2022
1 parent a93bcb3 commit 9ed6446
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM golang:1.18.6-alpine as builder
ENV CGO_ENABLED=0
#ENV CGO_ENABLED=0
COPY . /flowerss
RUN apk add git make && \
RUN apk add git make gcc libc-dev && \
cd /flowerss && make build

# Image starts here
Expand Down
2 changes: 1 addition & 1 deletion internal/model/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func connectDB() {
if config.EnableMysql {
db, err = gorm.Open("mysql", config.Mysql.GetMysqlConnectingString())
} else {
db, err = gorm.Open("sqlite", config.SQLitePath)
db, err = gorm.Open("sqlite3", config.SQLitePath)
}
if err != nil {
zap.S().Fatalf("connect db failed, err: %+v", err)
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/indes/flowerss-bot/internal/task"

_ "github.com/jinzhu/gorm/dialects/mysql"
_ "modernc.org/sqlite"
_ "github.com/jinzhu/gorm/dialects/sqlite"
)

func main() {
Expand Down

0 comments on commit 9ed6446

Please sign in to comment.