Skip to content

Commit

Permalink
Use pure-go SQLite driver instead of CGo implementatioon
Browse files Browse the repository at this point in the history
  • Loading branch information
tbavelier committed Apr 5, 2024
1 parent 491c840 commit 5b73966
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion LICENSE-3rdparty.csv
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,6 @@ core,github.com/mattn/go-colorable,MIT,Copyright (c) 2016 Yasuhiro Matsumoto
core,github.com/mattn/go-isatty,MIT,Copyright (c) Yasuhiro MATSUMOTO <mattn.jp@gmail.com>
core,github.com/mattn/go-runewidth,MIT,Copyright (c) 2016 Yasuhiro Matsumoto
core,github.com/mattn/go-shellwords,MIT,Copyright (c) 2017 Yasuhiro Matsumoto
core,github.com/mattn/go-sqlite3,MIT,Copyright (c) 2014 Yasuhiro Matsumoto
core,github.com/mdlayher/netlink,MIT,Copyright (C) 2016-2022 Matt Layher
core,github.com/mdlayher/netlink/nlenc,MIT,Copyright (C) 2016-2022 Matt Layher
core,github.com/mdlayher/socket,MIT,Copyright (C) 2021 Matt Layher
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,6 @@ require (
github.com/godror/godror v0.37.0
github.com/jmoiron/sqlx v1.3.5
github.com/kr/pretty v0.3.1
github.com/mattn/go-sqlite3 v1.14.16
github.com/planetscale/vtprotobuf v0.6.0
github.com/prometheus-community/pro-bing v0.3.0
github.com/rickar/props v1.0.0
Expand Down
4 changes: 2 additions & 2 deletions pkg/util/podman/sqlite_db_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"path/filepath"

// SQLite backend for database/sql
_ "github.com/mattn/go-sqlite3"
_ "modernc.org/sqlite"

"github.com/DataDog/datadog-agent/pkg/util/log"
)
Expand Down Expand Up @@ -59,7 +59,7 @@ func NewSQLDBClient(dbPath string) *SQLDBClient {
// Note: original function comes from https://github.com/containers/podman/blob/e71ec6f1d94d2d97fb3afe08aae0d8adaf8bddf0/libpod/sqlite_state.go#L57-L96
// It was adapted as we don't need to write any information to the DB.
func (client *SQLDBClient) getDBCon() (*sql.DB, error) {
conn, err := sql.Open("sqlite3", filepath.Join(client.DBPath, sqliteOptions))
conn, err := sql.Open("sqlite", filepath.Join(client.DBPath, sqliteOptions))
if err != nil {
return nil, fmt.Errorf("opening sqlite database: %w", err)
}
Expand Down

0 comments on commit 5b73966

Please sign in to comment.