Skip to content

Commit

Permalink
Merge pull request #95 from spinup-host/viggy/gh-94
Browse files Browse the repository at this point in the history
gh-94: To replace mattn/go-sqlite3 with cznic/sqlite
  • Loading branch information
viggy28 authored Feb 27, 2022
2 parents 276bdfc + 5f58674 commit b855585
Show file tree
Hide file tree
Showing 5 changed files with 156 additions and 38 deletions.
1 change: 0 additions & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
pre_command: export CGO_ENABLED=1
goversion: "https://dl.google.com/go/go1.16.5.linux-amd64.tar.gz"
binary_name: "spinup-backend"
ldflags: "-X 'main.apiVersion=$RELEASE_TAG_NAME'"
Expand Down
4 changes: 2 additions & 2 deletions api/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import (
"github.com/spinup-host/internal/dockerservice"

"github.com/docker/docker/client"
_ "github.com/mattn/go-sqlite3"
"github.com/robfig/cron/v3"
"github.com/spinup-host/backup"
"github.com/spinup-host/config"
"github.com/spinup-host/misc"
_ "modernc.org/sqlite"
)

type service struct {
Expand Down Expand Up @@ -286,7 +286,7 @@ func lastContainerID() (string, error) {
}

func OpenSqliteDB(path string) (*sql.DB, error) {
db, err := sql.Open("sqlite3", path)
db, err := sql.Open("sqlite", path)
if err != nil {
return nil, err
}
Expand Down
4 changes: 3 additions & 1 deletion api/list_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (
"os"

"github.com/spinup-host/config"

_ "modernc.org/sqlite"
)

func ListCluster(w http.ResponseWriter, req *http.Request) {
Expand Down Expand Up @@ -53,7 +55,7 @@ func ReadClusterInfo(path, dbName string) []clusterInfo {
log.Printf("INFO: no sqlite database")
return nil
}
db, err := sql.Open("sqlite3", dsn)
db, err := sql.Open("sqlite", dsn)
if err != nil {
log.Fatal(err)
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ require (
github.com/golang-jwt/jwt v3.2.1+incompatible
github.com/gorilla/mux v1.8.0 // indirect
github.com/gorilla/websocket v1.4.2
github.com/mattn/go-sqlite3 v1.14.8
github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/prometheus/client_golang v1.11.0
Expand All @@ -18,4 +17,5 @@ require (
github.com/rs/zerolog v1.25.0
github.com/spf13/cobra v1.2.1
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
modernc.org/sqlite v1.14.7
)
Loading

0 comments on commit b855585

Please sign in to comment.