diff --git a/README.md b/README.md index c003c66..f593494 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,9 @@ Storage interfaces separate the services from SQLite. ## Local development +Builds require CGO and a C compiler for the native SQLite driver. +The Nix development environment provides the compiler and enables CGO. + 1. Enter the development environment: ```sh diff --git a/docs/design.md b/docs/design.md index 39bb3a2..d9b5dc4 100644 --- a/docs/design.md +++ b/docs/design.md @@ -87,7 +87,7 @@ Public endpoints cannot access thresholds or register participants. ## Dependencies -- `modernc.org/sqlite` v1.60.1: SQLite without CGo, BSD-3-Clause. +- `github.com/mattn/go-sqlite3` v1.14.52: native SQLite through CGO, MIT. - `github.com/bluesky-social/indigo` v0.0.0-20261006083258-ae9297b7d0f4: ATProto support, Apache-2.0/MIT. - `sqlc`: SQL code generation, MIT. - `github.com/coder/websocket` v1.8.15: Jetstream client, MIT. diff --git a/docs/jetstream-replay.md b/docs/jetstream-replay.md index b390d3e..bdaf046 100644 --- a/docs/jetstream-replay.md +++ b/docs/jetstream-replay.md @@ -2,6 +2,10 @@ See [Appview traces](tracing.md) for optional storage and replay traces in VictoriaTraces. +The native SQLite driver uses the bundled SQLite source and requires CGO. +Existing SQLite databases need no format conversion or schema change for the driver switch. +The driver switch preserves the cache configuration, WAL/NORMAL durability, index deferral, and atomic replay checkpoints. + Historical replay is optional. The default appview still uses the legacy Microcosm stream. The v2 adapter reconstructs current records, not a complete mutation audit. The provider can compact deleted records from its archive. diff --git a/flake.nix b/flake.nix index 8443f6e..521f5b7 100644 --- a/flake.nix +++ b/flake.nix @@ -127,8 +127,10 @@ in { default = pkgs.mkShell { + CGO_ENABLED = "1"; packages = [ pkgs.go + pkgs.stdenv.cc pkgs.sqlc pkgs.sqlite self.packages.${system}.goat diff --git a/go.mod b/go.mod index 9962de8..41e3c53 100644 --- a/go.mod +++ b/go.mod @@ -7,12 +7,12 @@ require ( github.com/bluesky-social/jetstream v0.3.10 github.com/coder/websocket v1.8.15 github.com/jcalabro/atmos v0.7.3 + github.com/mattn/go-sqlite3 v1.14.52 github.com/prometheus/client_golang v1.25.0 go.opentelemetry.io/otel v1.47.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 go.opentelemetry.io/otel/sdk v1.47.0 go.opentelemetry.io/otel/trace v1.47.0 - modernc.org/sqlite v1.60.1 ) require ( @@ -24,7 +24,6 @@ require ( github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/pebble v1.1.5 // indirect github.com/cockroachdb/redact v1.1.5 // indirect - github.com/dustin/go-humanize v1.0.1 // indirect github.com/earthboundkid/versioninfo/v2 v2.24.1 // indirect github.com/getsentry/sentry-go v0.46.0 // indirect github.com/go-logr/logr v1.4.4 // indirect @@ -41,15 +40,12 @@ require ( github.com/klauspost/cpuid/v2 v2.4.0 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect - github.com/mattn/go-isatty v0.0.24 // indirect github.com/mr-tron/base58 v1.3.0 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/ncruces/go-strftime v1.0.0 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/prometheus/client_model v0.6.3 // indirect github.com/prometheus/common v0.72.0 // indirect github.com/prometheus/procfs v0.22.0 // indirect - github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect github.com/rogpeppe/go-internal v1.14.1 // indirect github.com/zeebo/xxh3 v1.1.0 // indirect gitlab.com/yawning/secp256k1-voi v0.0.0-20230925100816-f2616030848b // indirect @@ -69,7 +65,4 @@ require ( google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect google.golang.org/grpc v1.83.2 // indirect google.golang.org/protobuf v1.36.12 // indirect - modernc.org/libc v1.77.1 // indirect - modernc.org/mathutil v1.7.1 // indirect - modernc.org/memory v1.12.1 // indirect ) diff --git a/go.sum b/go.sum index ef1902b..86e46ea 100644 --- a/go.sum +++ b/go.sum @@ -23,8 +23,6 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/coder/websocket v1.8.15 h1:6B2JPeOGlpff2Uz6vOEH1Vzpi0iUz20A+lPVhPHtNUA= github.com/coder/websocket v1.8.15/go.mod h1:NX3SzP+inril6yawo5CQXx8+fk145lPDC6pumgx0mVg= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= -github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/earthboundkid/versioninfo/v2 v2.24.1 h1:SJTMHaoUx3GzjjnUO1QzP3ZXK6Ee/nbWyCm58eY3oUg= github.com/earthboundkid/versioninfo/v2 v2.24.1/go.mod h1:VcWEooDEuyUJnMfbdTh0uFN4cfEIg+kHMuWB2CDCLjw= github.com/felixge/httpsnoop v1.1.0 h1:3YtUj32ZZkqZtt3sZZsClsymw/QDuVfpNhoA31zeORc= @@ -49,8 +47,6 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/go-querystring v1.2.0 h1:yhqkPbu2/OH+V9BfpCVPZkNmUXhb2gBxJArfhIxNtP0= github.com/google/go-querystring v1.2.0/go.mod h1:8IFJqpSRITyJ8QhQ13bmbeMBDfmeEJZD5A0egEOmkqU= -github.com/google/pprof v0.0.0-20260802141513-ef3492d7dac3 h1:LMLX+LgTNWpfvCBdFebv6EsYotImrt/Ppc5cXIriCSo= -github.com/google/pprof v0.0.0-20260802141513-ef3492d7dac3/go.mod h1:jl5iWTm0/hd5PjEYEOuwAJ57L/CibdZfrqZ5XA5GrCk= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 h1:/Tnpcb2E0Pz/tN9s3bfEY2Q8ePCEX9iuS+cneUwncnw= @@ -77,8 +73,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/mattn/go-isatty v0.0.24 h1:tGZZoVgT/KiqK1c8ocVLeDS8BSWMRd47J3Lbz7vsReI= -github.com/mattn/go-isatty v0.0.24/go.mod h1:nMCL3Zebbrt45jsMDgnfIwz6ydEQApk5oEI3HqDio6A= +github.com/mattn/go-sqlite3 v1.14.52 h1:wVbm2Qnf4OXkqhBTSPuCRZDRnxfbVrrmiCEroVdog8U= +github.com/mattn/go-sqlite3 v1.14.52/go.mod h1:6JTjA44L93a0QCyJef5YvlPoKXntQPjzWv5gtm9sB6w= github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= github.com/mr-tron/base58 v1.3.0 h1:K6Y13R2h+dku0wOqKtecgRnBUBPrZzLZy5aIj8lCcJI= @@ -95,8 +91,6 @@ github.com/multiformats/go-varint v0.1.0 h1:i2wqFp4sdl3IcIxfAonHQV9qU5OsZ4Ts9IOo github.com/multiformats/go-varint v0.1.0/go.mod h1:5KVAVXegtfmNQQm/lCY+ATvDzvJJhSkUlGQV9wgObdI= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/ncruces/go-strftime v1.0.0 h1:HMFp8mLCTPp341M/ZnA4qaf7ZlsbTc+miZjCLOFAw7w= -github.com/ncruces/go-strftime v1.0.0/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= @@ -114,8 +108,6 @@ github.com/prometheus/procfs v0.22.0 h1:6q9+/JL9IKAPbCmBrv9n5O5Ty3NKnciV5X7YGw0o github.com/prometheus/procfs v0.22.0/go.mod h1:CvmFr/GVhIjIvWJZW3tgkODBQMRIf0EyWMQLHCHab58= github.com/puzpuzpuz/xsync/v4 v4.5.0 h1:vOSWu6b57/emh+L/Cw0BeQfvxa/cogFywXHeGUxQxAg= github.com/puzpuzpuz/xsync/v4 v4.5.0/go.mod h1:VJDmTCJMBt8igNxnkQd86r+8KUeN1quSfNKu5bLYFQo= -github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= -github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= @@ -170,8 +162,6 @@ golang.org/x/crypto v0.57.0 h1:3ZVCjf8Ggz7zneR/EHRVx68Ctf+2pmIMP2UFhh9cC6M= golang.org/x/crypto v0.57.0/go.mod h1:Fdz0i5U6CoizGwLda9DttjSk6qlZo25zYNtR+ycvuZA= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.41.0 h1:qJmnOUb4YB+FsEuM3HcWucdZASCPGhsX6uljO6pog0c= -golang.org/x/mod v0.41.0/go.mod h1:Ek9pY8RKWXwsWvd3rQiHYtMqkjSUV+s1Rj7j4H5Ur6o= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -198,8 +188,6 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.51.0 h1:k4Xc/1Om9jwkBJBo4NVLMSARBoWtK10mx+W5BnXCeAI= -golang.org/x/tools v0.51.0/go.mod h1:9eEncMayCV6zRMGhR5eZEC2iBx98qWcF1HZ9Z7wJOoA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -218,31 +206,3 @@ google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fw google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= lukechampine.com/blake3 v1.4.1 h1:I3Smz7gso8w4/TunLKec6K2fn+kyKtDxr/xcQEN84Wg= lukechampine.com/blake3 v1.4.1/go.mod h1:QFosUxmjB8mnrWFSNwKmvxHpfY72bmD2tQ0kBMM3kwo= -modernc.org/cc/v4 v4.29.7 h1:q+NXGJ0bK3b4TXFYQQVr9pYETGnmwFWkrUzJnMya/Tg= -modernc.org/cc/v4 v4.29.7/go.mod h1:OnovgIhbbMXMu1aISnJ0wvVD1KnW+cAUJkIrAWh+kVI= -modernc.org/ccgo/v4 v4.36.1 h1:ZNIUZAryN0UgnJwtyxrdEzcFc3yD4Cu4AzjfPXsLsIE= -modernc.org/ccgo/v4 v4.36.1/go.mod h1:rrtGc2QkS239nYb/mQNuBMyjq3/y3ZXWbBjPoV3wqzA= -modernc.org/fileutil v1.4.0 h1:j6ZzNTftVS054gi281TyLjHPp6CPHr2KCxEXjEbD6SM= -modernc.org/fileutil v1.4.0/go.mod h1:EqdKFDxiByqxLk8ozOxObDSfcVOv/54xDs/DUHdvCUU= -modernc.org/gc/v2 v2.6.5 h1:nyqdV8q46KvTpZlsw66kWqwXRHdjIlJOhG6kxiV/9xI= -modernc.org/gc/v2 v2.6.5/go.mod h1:YgIahr1ypgfe7chRuJi2gD7DBQiKSLMPgBQe9oIiito= -modernc.org/gc/v3 v3.1.5 h1:21ldfPfRYE31Tb7B3mwAK8gy1AxP4+dKjrOQPfqakoc= -modernc.org/gc/v3 v3.1.5/go.mod h1:HFK/6AGESC7Ex+EZJhJ2Gni6cTaYpSMmU/cT9RmlfYY= -modernc.org/goabi0 v0.2.0 h1:HvEowk7LxcPd0eq6mVOAEMai46V+i7Jrj13t4AzuNks= -modernc.org/goabi0 v0.2.0/go.mod h1:CEFRnnJhKvWT1c1JTI3Avm+tgOWbkOu5oPA8eH8LnMI= -modernc.org/libc v1.77.1 h1:Ct8j47QtiZ1Enj2DtFXQtUqrPCAjdCmPjtCuvrYQ0Hs= -modernc.org/libc v1.77.1/go.mod h1:87/pZ4L6nD1zqW4nItuS12YO7hN1igAah34xjnQo/W0= -modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU= -modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg= -modernc.org/memory v1.12.1 h1:nFMiWrpStgZczNl6XI9GnIk/rWhYIyHGUaR04pGbp9g= -modernc.org/memory v1.12.1/go.mod h1:/JP4VbVC+K5sU2wZi9bHoq2MAkCnrt2r98UGeSK7Mjw= -modernc.org/opt v0.2.0 h1:tGyef5ApycA7FSEOMraay9SaTk5zmbx7Tu+cJs4QKZg= -modernc.org/opt v0.2.0/go.mod h1:03fq9lsNfvkYSfxrfUhZCWPk1lm4cq4N+Bh//bEtgns= -modernc.org/sortutil v1.2.1 h1:+xyoGf15mM3NMlPDnFqrteY07klSFxLElE2PVuWIJ7w= -modernc.org/sortutil v1.2.1/go.mod h1:7ZI3a3REbai7gzCLcotuw9AC4VZVpYMjDzETGsSMqJE= -modernc.org/sqlite v1.60.1 h1:/blz53O951KWFOso4QQvEs/Fq6cDBKLtMVrYNSeJVKw= -modernc.org/sqlite v1.60.1/go.mod h1:1dIoEagfDE72QytD5scH1lxARtaUgKgHC/NuApA27r0= -modernc.org/strutil v1.2.1 h1:UneZBkQA+DX2Rp35KcM69cSsNES9ly8mQWD71HKlOA0= -modernc.org/strutil v1.2.1/go.mod h1:EHkiggD70koQxjVdSBM3JKM7k6L0FbGE5eymy9i3B9A= -modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y= -modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= diff --git a/internal/storage/comments_test.go b/internal/storage/comments_test.go index 47ac479..80dd290 100644 --- a/internal/storage/comments_test.go +++ b/internal/storage/comments_test.go @@ -13,7 +13,7 @@ import ( func TestCommentMigration(t *testing.T) { path := filepath.Join(t.TempDir(), "index.db") - conn, err := sql.Open("sqlite", path) + conn, err := sql.Open(sqliteDriver, path) if err != nil { t.Fatal(err) } diff --git a/internal/storage/compact_test.go b/internal/storage/compact_test.go index 3765e21..cb496b3 100644 --- a/internal/storage/compact_test.go +++ b/internal/storage/compact_test.go @@ -21,7 +21,7 @@ func TestCompactMigration(t *testing.T) { func testIdentityMigration(t *testing.T, version int) { ctx := context.Background() path := filepath.Join(t.TempDir(), "version6.db") - conn, err := sql.Open("sqlite", path) + conn, err := sql.Open(sqliteDriver, path) if err != nil { t.Fatal(err) } diff --git a/internal/storage/events_test.go b/internal/storage/events_test.go index 1a14719..7fd0e9c 100644 --- a/internal/storage/events_test.go +++ b/internal/storage/events_test.go @@ -138,7 +138,7 @@ func TestAccountLifecycle(t *testing.T) { func TestVersionOneMigration(t *testing.T) { path := filepath.Join(t.TempDir(), "old.db") - conn, err := sql.Open("sqlite", path) + conn, err := sql.Open(sqliteDriver, path) if err != nil { t.Fatal(err) } diff --git a/internal/storage/identities_test.go b/internal/storage/identities_test.go index 3274662..02f88b0 100644 --- a/internal/storage/identities_test.go +++ b/internal/storage/identities_test.go @@ -79,7 +79,7 @@ func TestIdentityKeys(t *testing.T) { func TestIdentityMigrationRollback(t *testing.T) { path := filepath.Join(t.TempDir(), "invalid.db") - conn, err := sql.Open("sqlite", path) + conn, err := sql.Open(sqliteDriver, path) if err != nil { t.Fatal(err) } diff --git a/internal/storage/soft_migration_test.go b/internal/storage/soft_migration_test.go index 31373a7..06278f5 100644 --- a/internal/storage/soft_migration_test.go +++ b/internal/storage/soft_migration_test.go @@ -13,7 +13,7 @@ import ( func TestSoftMigration(t *testing.T) { path := filepath.Join(t.TempDir(), "version4.db") - conn, err := sql.Open("sqlite", path) + conn, err := sql.Open(sqliteDriver, path) if err != nil { t.Fatal(err) } diff --git a/internal/storage/sqlite.go b/internal/storage/sqlite.go index a4bfdd2..c42919d 100644 --- a/internal/storage/sqlite.go +++ b/internal/storage/sqlite.go @@ -11,7 +11,7 @@ import ( "path/filepath" "time" - _ "modernc.org/sqlite" + _ "github.com/mattn/go-sqlite3" "provenance/internal/domain" "provenance/internal/storage/db" @@ -65,6 +65,7 @@ var softIndexes string const SchemaVersion = 12 +const sqliteDriver = "sqlite3" const sqliteCacheKiB = 16 * 1024 * 1024 const sqliteBusyTimeoutMS = 5000 @@ -108,7 +109,7 @@ func openSQLite(path string, mode domain.SoftMode, indexes ReplayIndexMode) (sto if err := file.Close(); err != nil { return nil, err } - conn, err := sql.Open("sqlite", path) + conn, err := sql.Open(sqliteDriver, path) if err != nil { return nil, err } diff --git a/internal/storage/trust_cache_test.go b/internal/storage/trust_cache_test.go index 1d57a5e..ac6aa23 100644 --- a/internal/storage/trust_cache_test.go +++ b/internal/storage/trust_cache_test.go @@ -147,7 +147,7 @@ func TestTrustCacheLifecycle(t *testing.T) { func TestTrustCacheMigration(t *testing.T) { path := filepath.Join(t.TempDir(), "version3.db") - conn, err := sql.Open("sqlite", path) + conn, err := sql.Open(sqliteDriver, path) if err != nil { t.Fatal(err) } diff --git a/nix/package.nix b/nix/package.nix index 6f0bdcc..a141ca4 100644 --- a/nix/package.nix +++ b/nix/package.nix @@ -23,8 +23,8 @@ buildGoModule { ]; }; - vendorHash = "sha256-XhgvqUsXTuUEKsuNf6C+m7fsYW9sOfKJ6i2NbztolfY="; - env.CGO_ENABLED = "0"; + vendorHash = "sha256-BYB8zmbIdAPLwYKHcm1gxF6qdW/7/UD8Zz3XSpA8uSo="; + env.CGO_ENABLED = "1"; # Include library tests even when the package contains only one service binary. checkPhase = ''