From 2bfc5a8a95f770ad3ce32e49fd0f3035915d20b4 Mon Sep 17 00:00:00 2001 From: Colin Date: Fri, 28 Aug 2020 14:32:17 -0700 Subject: [PATCH 1/3] switch to go-based SQLite driver fix sqlite watch by removing connect hook --- bench_test.go | 4 +- ext_reader_test.go | 2 +- go.mod | 6 +++ go.sum | 18 ++++++++ ldb.go | 5 ++- ldb_reader_test.go | 8 ++-- ldb_testing_test.go | 4 +- master.txt | 37 ++++++++++++++++ pkg/executive/db_executive_test.go | 2 +- pkg/executive/db_info.go | 8 ++-- pkg/executive/sql.go | 2 +- pkg/executive/test_executive.go | 2 +- pkg/ldb/ldbs.go | 6 ++- pkg/reflector/dml_source_test.go | 2 +- pkg/reflector/pipeline_test.go | 4 +- pkg/reflector/reflector_test.go | 8 ++-- pkg/sqlgen/sqlgen_test.go | 8 ++-- pkg/sqlite/driver.go | 53 ++++++++++++----------- pkg/sqlite/sqlite_watch.go | 69 +++++++++++++++--------------- pkg/sqlite/sqlite_watch_test.go | 4 +- pkg/supervisor/supervisor.go | 2 +- pkg/supervisor/supervisor_test.go | 6 +-- 22 files changed, 163 insertions(+), 97 deletions(-) create mode 100644 master.txt diff --git a/bench_test.go b/bench_test.go index dd0e48f0..ca71b0fe 100644 --- a/bench_test.go +++ b/bench_test.go @@ -24,7 +24,7 @@ func BenchmarkLDBQueryBaseline(b *testing.B) { defer os.RemoveAll(tmpDir) ldbPath := filepath.Join(tmpDir, "tmp.db") - localDB, err := sql.Open("sqlite3", ldbPath) + localDB, err := sql.Open("sqlite", ldbPath) if err != nil { b.Fatalf("Unexpected error opening LDB: %v", err) } @@ -94,7 +94,7 @@ func BenchmarkGetRowByKey(b *testing.B) { defer teardown() ldbPath := filepath.Join(testTmpDir, "tmp.db") - localDB, err := sql.Open("sqlite3", ldbPath) + localDB, err := sql.Open("sqlite", ldbPath) if err != nil { b.Fatalf("Unexpected error opening LDB: %v", err) } diff --git a/ext_reader_test.go b/ext_reader_test.go index 4c729976..71975fa9 100644 --- a/ext_reader_test.go +++ b/ext_reader_test.go @@ -24,7 +24,7 @@ CREATE TABLE family1___table1 ( INSERT INTO family1___table1 VALUES('foo', 'bar'); ` ctx := context.Background() - db, err := sql.Open("sqlite3", ":memory:") + db, err := sql.Open("sqlite", ":memory:") if err != nil { t.Fatalf("Unexpected error %+v", err) } diff --git a/go.mod b/go.mod index 0e1cad6a..cd91d82a 100644 --- a/go.mod +++ b/go.mod @@ -23,6 +23,7 @@ require ( github.com/segmentio/go-sqlite3 v1.12.0 github.com/segmentio/stats/v4 v4.6.2 github.com/stretchr/testify v1.8.1 + modernc.org/sqlite v1.4.0 ) require ( @@ -44,10 +45,12 @@ require ( github.com/aws/smithy-go v1.14.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect + github.com/mattn/go-isatty v0.0.12 // indirect github.com/mdlayher/genetlink v0.0.0-20190313224034-60417448a851 // indirect github.com/mdlayher/netlink v0.0.0-20190313131330-258ea9dff42c // indirect github.com/mdlayher/taskstats v0.0.0-20190313225729-7cbba52ee072 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect github.com/segmentio/fasthash v0.0.0-20180216231524-a72b379d632e // indirect github.com/segmentio/go-snakecase v1.1.0 // indirect github.com/segmentio/objconv v1.0.1 // indirect @@ -61,4 +64,7 @@ require ( gopkg.in/validator.v2 v2.0.0-20180514200540-135c24b11c19 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect + modernc.org/libc v1.0.0 // indirect + modernc.org/mathutil v1.1.1 // indirect + modernc.org/memory v1.0.0 // indirect ) diff --git a/go.sum b/go.sum index 64a25a05..f21d86d8 100644 --- a/go.sum +++ b/go.sum @@ -78,6 +78,8 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/maxbrunsfeld/counterfeiter/v6 v6.4.1 h1:hZD/8vBuw7x1WqRXD/WGjVjipbbo/HcDBgySYYbrUSk= github.com/maxbrunsfeld/counterfeiter/v6 v6.4.1/go.mod h1:DK1Cjkc0E49ShgRVs5jy5ASrM15svSnem3K/hiSGD8o= github.com/mdlayher/genetlink v0.0.0-20190313224034-60417448a851 h1:QYJTEbSDJvDBQenHYMxoiBQPgZ4QUcm75vACe3dkW7o= @@ -99,6 +101,8 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 h1:OdAsTTz6OkFY5QxjkYwrChwuRruF69c169dPK26NUlk= +github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8= github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM= github.com/segmentio/cli v0.5.1 h1:Xhtnmp0LrF+JHQTTV4Q58S79gG8JKXO4MMniyqc+XZs= @@ -163,6 +167,8 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -222,3 +228,15 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +modernc.org/httpfs v1.0.0 h1:LtuKNg6JMiaBKVQHKd6Phhvk+2GFp+pUcmDQgRjrds0= +modernc.org/httpfs v1.0.0/go.mod h1:BSkfoMUcahSijQD5J/Vu4UMOxzmEf5SNRwyXC4PJBEw= +modernc.org/libc v1.0.0 h1:MgQgjhJDgugN7makTrP2K503x+vKBy0EIv1o8uSuG0k= +modernc.org/libc v1.0.0/go.mod h1:iulSAj8W71uuiT8V3cOzJfRvrhNMz2kawtuJy18EEE4= +modernc.org/mathutil v1.1.1 h1:FeylZSVX8S+58VsyJlkEj2bcpdytmp9MmDKZkKx8OIE= +modernc.org/mathutil v1.1.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/memory v1.0.0 h1:Tm1p6vBp/U/SGR9/EeFhMvGzaVpUWeePopZhhIpW2YE= +modernc.org/memory v1.0.0/go.mod h1:TXr4iJDvK3g0hW+sV+Kohu7BoeHfqw7QEFZWkBExdZc= +modernc.org/sqlite v1.4.0 h1:rpQmt8iwSzPF9DuPRJ5EvesY+FLUohuaMTW1TJ9mtvY= +modernc.org/sqlite v1.4.0/go.mod h1:XnAfpewk8pgSsRFCaAMiAI4ljY/XHANDdf0Jxc0h5R4= +modernc.org/tcl v1.1.0 h1:rOb4Dtcf0aidHBu8Ctz3FkW+PQpgCrChEIQ9+LUPst0= +modernc.org/tcl v1.1.0/go.mod h1:8qvhdwj80wWqMugFAW2sduRIsdWBKOmxu+VwCXfE1X4= diff --git a/ldb.go b/ldb.go index 567b5f50..a65701b8 100644 --- a/ldb.go +++ b/ldb.go @@ -6,7 +6,8 @@ import ( "sync" "github.com/segmentio/ctlstore/pkg/ldb" - "github.com/segmentio/ctlstore/pkg/sqlite" + _ "modernc.org/sqlite" // gives us sqlite3 everywhere + // "github.com/segmentio/ctlstore/pkg/sqlite" ) const ( @@ -31,7 +32,7 @@ func init() { globalLDBVersioningDirPath = filepath.Join(envPath, defaultLDBVersioningSubdir) globalCLPath = filepath.Join(envPath, DefaultChangelogFilename) } - sqlite.InitDriver() + // sqlite.InitDriver() } // ReaderForPath opens an LDB at the provided path and returns an LDBReader diff --git a/ldb_reader_test.go b/ldb_reader_test.go index 612774b4..a9fe4ac9 100644 --- a/ldb_reader_test.go +++ b/ldb_reader_test.go @@ -397,7 +397,7 @@ func TestLDBReaderEmptyFileHandling(t *testing.T) { dbPath, teardown := ldb.NewLDBTmpPath(t) defer teardown() - db, err := sql.Open("sqlite3", dbPath) + db, err := sql.Open("sqlite", dbPath) if err != nil { t.Fatalf("Couldn't open SQLite db, error %v", err) } @@ -415,7 +415,7 @@ func TestLDBReaderEmptyFileHandling(t *testing.T) { t.Errorf("Expected %v, got %v", want, got) } - db2, err := sql.Open("sqlite3", dbPath) + db2, err := sql.Open("sqlite", dbPath) if err != nil { t.Fatalf("Couldn't open SQLite db, error %v", err) } @@ -454,7 +454,7 @@ func TestLDBReaderPing(t *testing.T) { dbPath, teardown := ldb.NewLDBTmpPath(t) defer teardown() - db, err := sql.Open("sqlite3", dbPath) + db, err := sql.Open("sqlite", dbPath) if err != nil { t.Fatalf("Couldn't open SQLite db, error %v", err) } @@ -530,7 +530,7 @@ func generateVersionedLDB(t *testing.T, path string, timestamp int64) { require.NoError(os.Mkdir(dirPath, 0755)) dbPath := filepath.Join(dirPath, "ldb.db") - db, err := sql.Open("sqlite3", dbPath) + db, err := sql.Open("sqlite", dbPath) require.NoError(err) // Initialize the ctlstore LDB tables: diff --git a/ldb_testing_test.go b/ldb_testing_test.go index 4ff8416f..9acab963 100644 --- a/ldb_testing_test.go +++ b/ldb_testing_test.go @@ -55,7 +55,7 @@ func TestLDBTestUtilCreateTableAndInsertRows(t *testing.T) { for i, testCase := range suite { t.Run(fmt.Sprintf("[%d]%s", i, testCase.desc), func(t *testing.T) { - db, err := sql.Open("sqlite3", ":memory:") + db, err := sql.Open("sqlite", ":memory:") if err != nil { t.Fatalf("Unexpected error: %+v", err) } @@ -115,7 +115,7 @@ func TestLDBTestUtilCreateTableAndInsertRows(t *testing.T) { } func TestLDBTestUtilReset(t *testing.T) { - db, err := sql.Open("sqlite3", ":memory:") + db, err := sql.Open("sqlite", ":memory:") if err != nil { t.Fatalf("Unexpected error: %+v", err) } diff --git a/master.txt b/master.txt new file mode 100644 index 00000000..08eb97f6 --- /dev/null +++ b/master.txt @@ -0,0 +1,37 @@ +goos: darwin +goarch: amd64 +pkg: github.com/segmentio/ctlstore +BenchmarkLDBQueryBaseline-8 51636 25530 ns/op +BenchmarkLDBQueryBaseline-8 46780 23614 ns/op +BenchmarkLDBQueryBaseline-8 50294 23006 ns/op +BenchmarkLDBQueryBaseline-8 52845 22155 ns/op +BenchmarkLDBQueryBaseline-8 53202 23052 ns/op +BenchmarkLDBQueryBaseline-8 48765 25969 ns/op +BenchmarkLDBQueryBaseline-8 51561 24321 ns/op +BenchmarkLDBQueryBaseline-8 52063 22644 ns/op +BenchmarkGetRowByKey-8 38980 32249 ns/op +BenchmarkGetRowByKey-8 37669 30814 ns/op +BenchmarkGetRowByKey-8 38571 34997 ns/op +BenchmarkGetRowByKey-8 38233 31320 ns/op +BenchmarkGetRowByKey-8 40298 31642 ns/op +BenchmarkGetRowByKey-8 37394 31976 ns/op +BenchmarkGetRowByKey-8 38244 31664 ns/op +BenchmarkGetRowByKey-8 40040 34356 ns/op +BenchmarkStructGetRowByKey-8 99262 12251 ns/op 1363 B/op 39 allocs/op +BenchmarkStructGetRowByKey-8 93758 12501 ns/op 1364 B/op 39 allocs/op +BenchmarkStructGetRowByKey-8 104388 11313 ns/op 1361 B/op 39 allocs/op +BenchmarkStructGetRowByKey-8 105907 11503 ns/op 1362 B/op 39 allocs/op +BenchmarkStructGetRowByKey-8 104948 11310 ns/op 1366 B/op 39 allocs/op +BenchmarkStructGetRowByKey-8 104775 11313 ns/op 1365 B/op 39 allocs/op +BenchmarkStructGetRowByKey-8 106152 11270 ns/op 1361 B/op 39 allocs/op +BenchmarkStructGetRowByKey-8 107226 11358 ns/op 1366 B/op 39 allocs/op +BenchmarkMapGetRowByKey-8 104768 11621 ns/op 1462 B/op 41 allocs/op +BenchmarkMapGetRowByKey-8 103082 11669 ns/op 1464 B/op 41 allocs/op +BenchmarkMapGetRowByKey-8 103173 11639 ns/op 1466 B/op 41 allocs/op +BenchmarkMapGetRowByKey-8 104032 11611 ns/op 1467 B/op 41 allocs/op +BenchmarkMapGetRowByKey-8 100960 11645 ns/op 1464 B/op 41 allocs/op +BenchmarkMapGetRowByKey-8 103995 11903 ns/op 1465 B/op 41 allocs/op +BenchmarkMapGetRowByKey-8 85936 12531 ns/op 1463 B/op 41 allocs/op +BenchmarkMapGetRowByKey-8 97444 12115 ns/op 1465 B/op 41 allocs/op +PASS +ok github.com/segmentio/ctlstore 50.610s diff --git a/pkg/executive/db_executive_test.go b/pkg/executive/db_executive_test.go index 0616267e..1fd4797b 100644 --- a/pkg/executive/db_executive_test.go +++ b/pkg/executive/db_executive_test.go @@ -195,7 +195,7 @@ func newCtlDBTestConnection(t *testing.T, dbType string) (*sql.DB, func()) { schemaUp = testCtlDBSchemaUpForSQLite3 tmpDir, td := tests.WithTmpDir(t) teardowns.Add(td) - db, err = sql.Open("sqlite3", filepath.Join(tmpDir, "ctldb.db")) + db, err = sql.Open("sqlite", filepath.Join(tmpDir, "ctldb.db")) default: t.Fatalf("unknown dbtype %q", dbType) } diff --git a/pkg/executive/db_info.go b/pkg/executive/db_info.go index a0ae9743..715f1c8d 100644 --- a/pkg/executive/db_info.go +++ b/pkg/executive/db_info.go @@ -8,8 +8,8 @@ import ( "github.com/go-sql-driver/mysql" mysql2 "github.com/segmentio/ctlstore/pkg/mysql" "github.com/segmentio/ctlstore/pkg/schema" - sqlite2 "github.com/segmentio/ctlstore/pkg/sqlite" - sqlite "github.com/segmentio/go-sqlite3" + // sqlite2 "github.com/segmentio/ctlstore/pkg/sqlite" + // "modernc.org/sqlite" ) type sqlDBInfo interface { @@ -21,8 +21,8 @@ func getDBInfo(db *sql.DB) sqlDBInfo { switch t := db.Driver().(type) { case *mysql.MySQLDriver: return &mysql2.MySQLDBInfo{Db: db} - case *sqlite.SQLiteDriver: - return &sqlite2.SqliteDBInfo{Db: db} + // case *sqlite.SQLiteDriver: + // return &sqlite2.SqliteDBInfo{Db: db} default: panic(fmt.Sprintf("Invalid driver type %T", t)) } diff --git a/pkg/executive/sql.go b/pkg/executive/sql.go index ce149d4b..c7c4601b 100644 --- a/pkg/executive/sql.go +++ b/pkg/executive/sql.go @@ -5,7 +5,7 @@ import ( "database/sql" "strings" - _ "github.com/segmentio/go-sqlite3" // gives us sqlite3 everywhere + _ "modernc.org/sqlite" // gives us sqlite3 everywhere ) // SQLDBClient allows generalizing several database/sql types diff --git a/pkg/executive/test_executive.go b/pkg/executive/test_executive.go index 08f53f63..3ed94ffe 100644 --- a/pkg/executive/test_executive.go +++ b/pkg/executive/test_executive.go @@ -33,7 +33,7 @@ func NewTestExecutiveService(bindTo string) (*TestExecutiveService, error) { return nil, err } - db, err := sql.Open("sqlite3", filepath.Join(tmpDir, "ctldb.db")) + db, err := sql.Open("sqlite", filepath.Join(tmpDir, "ctldb.db")) if err != nil { return nil, err } diff --git a/pkg/ldb/ldbs.go b/pkg/ldb/ldbs.go index 9fca941d..2b5fe91d 100644 --- a/pkg/ldb/ldbs.go +++ b/pkg/ldb/ldbs.go @@ -75,12 +75,14 @@ func LDBForTest(t testing.TB) (res *sql.DB, teardown func()) { } func OpenLDB(path string, mode string) (*sql.DB, error) { - return sql.Open("sqlite3_with_autocheckpoint_off", + // TODO: sqlite3_with_autocheckpoint_off for modernc.org/sqlite + return sql.Open("sqlite", fmt.Sprintf("file:%s?_journal_mode=wal&mode=%s", path, mode)) } func OpenImmutableLDB(path string) (*sql.DB, error) { - return sql.Open("sqlite3_with_autocheckpoint_off", fmt.Sprintf("file:%s?immutable=true", path)) + // TODO: sqlite3_with_autocheckpoint_off for modernc.org/sqlite + return sql.Open("sqlite", fmt.Sprintf("file:%s?immutable=true", path)) } // Ensures the LDB is prepared for queries diff --git a/pkg/reflector/dml_source_test.go b/pkg/reflector/dml_source_test.go index ccf90249..a69268e5 100644 --- a/pkg/reflector/dml_source_test.go +++ b/pkg/reflector/dml_source_test.go @@ -46,7 +46,7 @@ func (u *sqlDmlSourceTestUtil) AddStatement(statement string) string { func TestSqlDmlSource(t *testing.T) { ctx := context.Background() - db, err := sql.Open("sqlite3", ":memory:") + db, err := sql.Open("sqlite", ":memory:") require.NoError(t, err) srcutil := &sqlDmlSourceTestUtil{db: db, t: t} diff --git a/pkg/reflector/pipeline_test.go b/pkg/reflector/pipeline_test.go index 1763b32b..77e0e21c 100644 --- a/pkg/reflector/pipeline_test.go +++ b/pkg/reflector/pipeline_test.go @@ -14,11 +14,11 @@ import ( func TestPipelineIntegration(t *testing.T) { var err error ctx := context.Background() - ldb, err := sql.Open("sqlite3", ":memory:") + ldb, err := sql.Open("sqlite", ":memory:") if err != nil { t.Fatalf("Couldn't open LDB, error: %+v", err) } - ctldb, err := sql.Open("sqlite3", ":memory:") + ctldb, err := sql.Open("sqlite", ":memory:") if err != nil { t.Fatalf("Couldn't open ctldb, error: %+v", err) } diff --git a/pkg/reflector/reflector_test.go b/pkg/reflector/reflector_test.go index 1e77086e..e3bd00e1 100644 --- a/pkg/reflector/reflector_test.go +++ b/pkg/reflector/reflector_test.go @@ -33,12 +33,12 @@ func TestShovelSequenceReset(t *testing.T) { emptyLdbPath := filepath.Join(tmpPath, "emptyLdb.db") upstreamSQL := ctldb.CtlDBSchemaByDriver["sqlite3"] - upstreamDB, err := sql.Open("sqlite3", upstreamDbPath) + upstreamDB, err := sql.Open("sqlite", upstreamDbPath) require.NoError(t, err) _, err = upstreamDB.Exec(upstreamSQL) require.NoError(t, err) - ldbDB, err := sql.Open("sqlite3", emptyLdbPath) + ldbDB, err := sql.Open("sqlite", emptyLdbPath) require.NoError(t, err) defer ldbDB.Close() @@ -126,7 +126,7 @@ func TestReflector(t *testing.T) { changelogPath := filepath.Join(tmpPath, "changelog") emptyLdbPath := filepath.Join(tmpPath, "emptyLdb.db") - ldbDB, err := sql.Open("sqlite3", emptyLdbPath) + ldbDB, err := sql.Open("sqlite", emptyLdbPath) require.NoError(t, err) defer ldbDB.Close() @@ -158,7 +158,7 @@ func TestReflector(t *testing.T) { } ctx, cancel := context.WithCancel(context.Background()) - upstreamDb, err := sql.Open("sqlite3", upstreamDbPath) + upstreamDb, err := sql.Open("sqlite", upstreamDbPath) require.NoError(t, err) defer upstreamDb.Close() diff --git a/pkg/sqlgen/sqlgen_test.go b/pkg/sqlgen/sqlgen_test.go index 1e1d058d..3ffbb7ee 100644 --- a/pkg/sqlgen/sqlgen_test.go +++ b/pkg/sqlgen/sqlgen_test.go @@ -14,7 +14,7 @@ import ( _ "github.com/go-sql-driver/mysql" "github.com/segmentio/ctlstore/pkg/ctldb" "github.com/segmentio/ctlstore/pkg/schema" - _ "github.com/segmentio/go-sqlite3" + _ "modernc.org/sqlite" // gives us sqlite3 everywhere ) func TestMetaTableAsCreateTableDDL(t *testing.T) { @@ -49,7 +49,7 @@ func TestMetaTableAsCreateTableDDL(t *testing.T) { } ddl := want - db, err := sql.Open("sqlite3", ":memory:") + db, err := sql.Open("sqlite", ":memory:") if err != nil { t.Fatalf("Unexpected error opening SQLite3 DB: %v", err) } @@ -119,7 +119,7 @@ func TestMetaTableAddColumnDDL(t *testing.T) { } { - db, err := sql.Open("sqlite3", ":memory:") + db, err := sql.Open("sqlite", ":memory:") if err != nil { t.Fatalf("Unexpected error opening SQLite3 DB: %v", err) } @@ -370,7 +370,7 @@ func TestSQLQuote(t *testing.T) { testName := fmt.Sprintf("%d_%s", caseIdx, testCase.desc) t.Run(testName, func(t *testing.T) { - sqliteDb, err := sql.Open("sqlite3", ":memory:") + sqliteDb, err := sql.Open("sqlite", ":memory:") if err != nil { t.Fatalf("Unexpected error: %v", err) } diff --git a/pkg/sqlite/driver.go b/pkg/sqlite/driver.go index 72a75c6c..85283a03 100644 --- a/pkg/sqlite/driver.go +++ b/pkg/sqlite/driver.go @@ -1,32 +1,33 @@ package sqlite -import ( - "database/sql" - "sync" +// TODO: support disabling auto checkpoint with modernc.org/sqlite +// import ( +// "database/sql" +// "sync" - "github.com/segmentio/go-sqlite3" - _ "github.com/segmentio/go-sqlite3" -) +// "github.com/segmentio/go-sqlite3" +// _ "github.com/segmentio/go-sqlite3" +// ) -func init() { - InitDriver() -} +// func init() { +// InitDriver() +// } -var initDriverOnce sync.Once +// var initDriverOnce sync.Once -// InitDriver ensures that the sqlite3 driver is initialized -func InitDriver() { - initDriverOnce.Do(func() { - sql.Register("sqlite3_with_autocheckpoint_off", &sqlite3.SQLiteDriver{ - ConnectHook: func(conn *sqlite3.SQLiteConn) error { - // This turns off automatic WAL checkpoints in the reader. Since the reader - // can't do checkpoints as it's usually in read-only mode, checkpoints only - // result in an error getting returned to callers in some circumstances. - // As the Reflector is the only writer to the LDB, and it will continue to - // run checkpoints, the WAL will stay nice and tidy. - _, err := conn.Exec("PRAGMA wal_autocheckpoint = 0", nil) - return err - }, - }) - }) -} +// // InitDriver ensures that the sqlite3 driver is initialized +// func InitDriver() { +// initDriverOnce.Do(func() { +// sql.Register("sqlite3_with_autocheckpoint_off", &sqlite3.SQLiteDriver{ +// ConnectHook: func(conn *sqlite3.SQLiteConn) error { +// // This turns off automatic WAL checkpoints in the reader. Since the reader +// // can't do checkpoints as it's usually in read-only mode, checkpoints only +// // result in an error getting returned to callers in some circumstances. +// // As the Reflector is the only writer to the LDB, and it will continue to +// // run checkpoints, the WAL will stay nice and tidy. +// _, err := conn.Exec("PRAGMA wal_autocheckpoint = 0", nil) +// return err +// }, +// }) +// }) +// } diff --git a/pkg/sqlite/sqlite_watch.go b/pkg/sqlite/sqlite_watch.go index 9d351ce7..5a4a07bb 100644 --- a/pkg/sqlite/sqlite_watch.go +++ b/pkg/sqlite/sqlite_watch.go @@ -7,7 +7,7 @@ import ( "github.com/pkg/errors" "github.com/segmentio/ctlstore/pkg/scanfunc" "github.com/segmentio/ctlstore/pkg/schema" - "github.com/segmentio/go-sqlite3" + // sqlite3 "modernc.org/sqlite" ) type ( @@ -33,42 +33,43 @@ type ( // database. These messages are pre-update, so the buffer will be populated // before the change is committed. func RegisterSQLiteWatch(dbName string, buffer *SQLChangeBuffer) error { - sql.Register(dbName, &sqlite3.SQLiteDriver{ - ConnectHook: func(conn *sqlite3.SQLiteConn) error { - conn.RegisterPreUpdateHook(func(pud sqlite3.SQLitePreUpdateData) { - cnt := pud.Count() - var newRow []interface{} - var oldRow []interface{} + // TODO: support connect hooks with modernc.org/sqlite + // sql.Register(dbName, &sqlite3.SQLiteDriver{ + // ConnectHook: func(conn *sqlite3.SQLiteConn) error { + // conn.RegisterPreUpdateHook(func(pud sqlite3.SQLitePreUpdateData) { + // cnt := pud.Count() + // var newRow []interface{} + // var oldRow []interface{} - if pud.Op == sqlite3.SQLITE_UPDATE || pud.Op == sqlite3.SQLITE_DELETE { - oldRow = make([]interface{}, cnt) - err := pud.Old(oldRow...) - if err != nil { - return - } - } + // if pud.Op == sqlite3.SQLITE_UPDATE || pud.Op == sqlite3.SQLITE_DELETE { + // oldRow = make([]interface{}, cnt) + // err := pud.Old(oldRow...) + // if err != nil { + // return + // } + // } - if pud.Op == sqlite3.SQLITE_UPDATE || pud.Op == sqlite3.SQLITE_INSERT { - newRow = make([]interface{}, cnt) - err := pud.New(newRow...) - if err != nil { - return - } - } + // if pud.Op == sqlite3.SQLITE_UPDATE || pud.Op == sqlite3.SQLITE_INSERT { + // newRow = make([]interface{}, cnt) + // err := pud.New(newRow...) + // if err != nil { + // return + // } + // } - buffer.Add(SQLiteWatchChange{ - Op: pud.Op, - DatabaseName: pud.DatabaseName, - TableName: pud.TableName, - OldRowID: pud.OldRowID, - NewRowID: pud.NewRowID, - OldRow: oldRow, - NewRow: newRow, - }) - }) - return nil - }, - }) + // buffer.Add(SQLiteWatchChange{ + // Op: pud.Op, + // DatabaseName: pud.DatabaseName, + // TableName: pud.TableName, + // OldRowID: pud.OldRowID, + // NewRowID: pud.NewRowID, + // OldRow: oldRow, + // NewRow: newRow, + // }) + // }) + // return nil + // }, + // }) return nil } diff --git a/pkg/sqlite/sqlite_watch_test.go b/pkg/sqlite/sqlite_watch_test.go index c48e6f0a..cd426263 100644 --- a/pkg/sqlite/sqlite_watch_test.go +++ b/pkg/sqlite/sqlite_watch_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - sqlite3 "github.com/segmentio/go-sqlite3" + sqlite3 "modernc.org/sqlite" "github.com/stretchr/testify/assert" ) @@ -174,7 +174,7 @@ func TestSQLiteWatchChangeExtractKeys(t *testing.T) { for _, testCase := range suite { t.Run(testCase.desc, func(t *testing.T) { - db, err := sql.Open("sqlite3", ":memory:") + db, err := sql.Open("sqlite", ":memory:") if err != nil { t.Fatalf("Unexpected error: %v", err) } diff --git a/pkg/supervisor/supervisor.go b/pkg/supervisor/supervisor.go index 05f1e013..74fb9cff 100644 --- a/pkg/supervisor/supervisor.go +++ b/pkg/supervisor/supervisor.go @@ -87,7 +87,7 @@ func (s *supervisor) snapshot(ctx context.Context) error { func (s *supervisor) checkpointLDB() error { ctx := context.Background() // we do not want to interrupt this operation - srcDb, err := sql.Open("sqlite3", s.LDBPath+"?_journal_mode=wal") + srcDb, err := sql.Open("sqlite", s.LDBPath+"?_journal_mode=wal") if err != nil { return errors.Wrap(err, "opening source db") } diff --git a/pkg/supervisor/supervisor_test.go b/pkg/supervisor/supervisor_test.go index 1d85cf54..a2035fdd 100644 --- a/pkg/supervisor/supervisor_test.go +++ b/pkg/supervisor/supervisor_test.go @@ -66,7 +66,7 @@ func TestSupervisor(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - ldb, err := sql.Open("sqlite3", ldbDbPath+"?_journal_mode=wal&cache=shared") + ldb, err := sql.Open("sqlite", ldbDbPath+"?_journal_mode=wal&cache=shared") require.NoError(t, err) err = ldbpkg.EnsureLdbInitialized(ctx, ldb) @@ -147,7 +147,7 @@ func TestSupervisor(t *testing.T) { stoppedCh <- struct{}{} handleFatalities() - archDb, err := sql.Open("sqlite3", archivePath) + archDb, err := sql.Open("sqlite", archivePath) require.NoError(t, err) row := archDb.QueryRow( @@ -173,7 +173,7 @@ func TestSupervisorSnapshotReflectorCtl(t *testing.T) { ldbDbPath := filepath.Join(tmpPath, "ldb.db") archivePath := filepath.Join(tmpPath, "archive.db") - ldb, err := sql.Open("sqlite3", ldbDbPath+"?_journal_mode=wal&cache=shared") + ldb, err := sql.Open("sqlite", ldbDbPath+"?_journal_mode=wal&cache=shared") require.NoError(t, err) err = ldbpkg.EnsureLdbInitialized(ctx, ldb) require.NoError(t, err) From d2e3bddee3b90bdb6d1db9bd654c6c64d6f1e7b2 Mon Sep 17 00:00:00 2001 From: Erik Weathers Date: Fri, 27 Oct 2023 02:16:28 -0700 Subject: [PATCH 2/3] update to modernc.org/sqlite@v1.26.0 --- go.mod | 24 ++++++++++++++++-------- go.sum | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index cd91d82a..877a5f86 100644 --- a/go.mod +++ b/go.mod @@ -10,8 +10,8 @@ require ( github.com/aws/aws-sdk-go-v2/service/s3 v1.38.5 github.com/fsnotify/fsnotify v1.5.1 github.com/go-sql-driver/mysql v1.4.1 - github.com/google/go-cmp v0.5.8 - github.com/google/uuid v1.1.2 + github.com/google/go-cmp v0.5.9 + github.com/google/uuid v1.3.0 github.com/gorilla/mux v1.7.3 github.com/julienschmidt/httprouter v1.2.0 github.com/maxbrunsfeld/counterfeiter/v6 v6.4.1 @@ -23,7 +23,7 @@ require ( github.com/segmentio/go-sqlite3 v1.12.0 github.com/segmentio/stats/v4 v4.6.2 github.com/stretchr/testify v1.8.1 - modernc.org/sqlite v1.4.0 + modernc.org/sqlite v1.26.0 ) require ( @@ -44,13 +44,15 @@ require ( github.com/aws/aws-sdk-go-v2/service/sts v1.22.0 // indirect github.com/aws/smithy-go v1.14.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/dustin/go-humanize v1.0.1 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect - github.com/mattn/go-isatty v0.0.12 // indirect + github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect + github.com/mattn/go-isatty v0.0.16 // indirect github.com/mdlayher/genetlink v0.0.0-20190313224034-60417448a851 // indirect github.com/mdlayher/netlink v0.0.0-20190313131330-258ea9dff42c // indirect github.com/mdlayher/taskstats v0.0.0-20190313225729-7cbba52ee072 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect + github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect github.com/segmentio/fasthash v0.0.0-20180216231524-a72b379d632e // indirect github.com/segmentio/go-snakecase v1.1.0 // indirect github.com/segmentio/objconv v1.0.1 // indirect @@ -64,7 +66,13 @@ require ( gopkg.in/validator.v2 v2.0.0-20180514200540-135c24b11c19 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - modernc.org/libc v1.0.0 // indirect - modernc.org/mathutil v1.1.1 // indirect - modernc.org/memory v1.0.0 // indirect + lukechampine.com/uint128 v1.2.0 // indirect + modernc.org/cc/v3 v3.40.0 // indirect + modernc.org/ccgo/v3 v3.16.13 // indirect + modernc.org/libc v1.24.1 // indirect + modernc.org/mathutil v1.5.0 // indirect + modernc.org/memory v1.6.0 // indirect + modernc.org/opt v0.1.3 // indirect + modernc.org/strutil v1.1.3 // indirect + modernc.org/token v1.0.1 // indirect ) diff --git a/go.sum b/go.sum index f21d86d8..e2d20077 100644 --- a/go.sum +++ b/go.sum @@ -45,6 +45,8 @@ github.com/aws/smithy-go v1.14.2/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +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/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= @@ -64,8 +66,11 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= @@ -75,11 +80,15 @@ github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGw github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/julienschmidt/httprouter v1.2.0 h1:TDTW5Yz1mjftljbcKqRcrYhd4XeOoI98t+9HbQbYf7g= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= +github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/maxbrunsfeld/counterfeiter/v6 v6.4.1 h1:hZD/8vBuw7x1WqRXD/WGjVjipbbo/HcDBgySYYbrUSk= github.com/maxbrunsfeld/counterfeiter/v6 v6.4.1/go.mod h1:DK1Cjkc0E49ShgRVs5jy5ASrM15svSnem3K/hiSGD8o= github.com/mdlayher/genetlink v0.0.0-20190313224034-60417448a851 h1:QYJTEbSDJvDBQenHYMxoiBQPgZ4QUcm75vACe3dkW7o= @@ -103,6 +112,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 h1:OdAsTTz6OkFY5QxjkYwrChwuRruF69c169dPK26NUlk= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +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/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8= github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM= github.com/segmentio/cli v0.5.1 h1:Xhtnmp0LrF+JHQTTV4Q58S79gG8JKXO4MMniyqc+XZs= @@ -178,6 +189,7 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -228,15 +240,37 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +lukechampine.com/uint128 v1.2.0 h1:mBi/5l91vocEN8otkC5bDLhi2KdCticRiwbdB0O+rjI= +lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= +modernc.org/cc/v3 v3.40.0 h1:P3g79IUS/93SYhtoeaHW+kRCIrYaxJ27MFPv+7kaTOw= +modernc.org/cc/v3 v3.40.0/go.mod h1:/bTg4dnWkSXowUO6ssQKnOV0yMVxDYNIsIrzqTFDGH0= +modernc.org/ccgo/v3 v3.16.13 h1:Mkgdzl46i5F/CNR/Kj80Ri59hC8TKAhZrYSaqvkwzUw= +modernc.org/ccgo/v3 v3.16.13/go.mod h1:2Quk+5YgpImhPjv2Qsob1DnZ/4som1lJTodubIcoUkY= modernc.org/httpfs v1.0.0 h1:LtuKNg6JMiaBKVQHKd6Phhvk+2GFp+pUcmDQgRjrds0= modernc.org/httpfs v1.0.0/go.mod h1:BSkfoMUcahSijQD5J/Vu4UMOxzmEf5SNRwyXC4PJBEw= +modernc.org/httpfs v1.0.6 h1:AAgIpFZRXuYnkjftxTAZwMIiwEqAfk8aVB2/oA6nAeM= modernc.org/libc v1.0.0 h1:MgQgjhJDgugN7makTrP2K503x+vKBy0EIv1o8uSuG0k= modernc.org/libc v1.0.0/go.mod h1:iulSAj8W71uuiT8V3cOzJfRvrhNMz2kawtuJy18EEE4= +modernc.org/libc v1.24.1 h1:uvJSeCKL/AgzBo2yYIPPTy82v21KgGnizcGYfBHaNuM= +modernc.org/libc v1.24.1/go.mod h1:FmfO1RLrU3MHJfyi9eYYmZBfi/R+tqZ6+hQ3yQQUkak= modernc.org/mathutil v1.1.1 h1:FeylZSVX8S+58VsyJlkEj2bcpdytmp9MmDKZkKx8OIE= modernc.org/mathutil v1.1.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/mathutil v1.5.0 h1:rV0Ko/6SfM+8G+yKiyI830l3Wuz1zRutdslNoQ0kfiQ= +modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= modernc.org/memory v1.0.0 h1:Tm1p6vBp/U/SGR9/EeFhMvGzaVpUWeePopZhhIpW2YE= modernc.org/memory v1.0.0/go.mod h1:TXr4iJDvK3g0hW+sV+Kohu7BoeHfqw7QEFZWkBExdZc= +modernc.org/memory v1.6.0 h1:i6mzavxrE9a30whzMfwf7XWVODx2r5OYXvU46cirX7o= +modernc.org/memory v1.6.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= +modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= +modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= modernc.org/sqlite v1.4.0 h1:rpQmt8iwSzPF9DuPRJ5EvesY+FLUohuaMTW1TJ9mtvY= modernc.org/sqlite v1.4.0/go.mod h1:XnAfpewk8pgSsRFCaAMiAI4ljY/XHANDdf0Jxc0h5R4= +modernc.org/sqlite v1.26.0 h1:SocQdLRSYlA8W99V8YH0NES75thx19d9sB/aFc4R8Lw= +modernc.org/sqlite v1.26.0/go.mod h1:FL3pVXie73rg3Rii6V/u5BoHlSoyeZeIgKZEgHARyCU= +modernc.org/strutil v1.1.3 h1:fNMm+oJklMGYfU9Ylcywl0CO5O6nTfaowNsh2wpPjzY= +modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= modernc.org/tcl v1.1.0 h1:rOb4Dtcf0aidHBu8Ctz3FkW+PQpgCrChEIQ9+LUPst0= modernc.org/tcl v1.1.0/go.mod h1:8qvhdwj80wWqMugFAW2sduRIsdWBKOmxu+VwCXfE1X4= +modernc.org/tcl v1.15.2 h1:C4ybAYCGJw968e+Me18oW55kD/FexcHbqH2xak1ROSY= +modernc.org/token v1.0.1 h1:A3qvTqOwexpfZZeyI0FeGPDlSWX5pjZu9hF4lU+EKWg= +modernc.org/token v1.0.1/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= From 28ffcf28dfaca4b03ba2ded4d7417ee2569ac213 Mon Sep 17 00:00:00 2001 From: Erik Weathers Date: Fri, 27 Oct 2023 12:24:16 -0700 Subject: [PATCH 3/3] go mod tidy --- go.sum | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/go.sum b/go.sum index e2d20077..00b62788 100644 --- a/go.sum +++ b/go.sum @@ -64,11 +64,10 @@ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5a github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw= @@ -85,10 +84,9 @@ github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:C github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= github.com/maxbrunsfeld/counterfeiter/v6 v6.4.1 h1:hZD/8vBuw7x1WqRXD/WGjVjipbbo/HcDBgySYYbrUSk= github.com/maxbrunsfeld/counterfeiter/v6 v6.4.1/go.mod h1:DK1Cjkc0E49ShgRVs5jy5ASrM15svSnem3K/hiSGD8o= github.com/mdlayher/genetlink v0.0.0-20190313224034-60417448a851 h1:QYJTEbSDJvDBQenHYMxoiBQPgZ4QUcm75vACe3dkW7o= @@ -110,7 +108,6 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 h1:OdAsTTz6OkFY5QxjkYwrChwuRruF69c169dPK26NUlk= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= @@ -178,8 +175,6 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -246,31 +241,21 @@ modernc.org/cc/v3 v3.40.0 h1:P3g79IUS/93SYhtoeaHW+kRCIrYaxJ27MFPv+7kaTOw= modernc.org/cc/v3 v3.40.0/go.mod h1:/bTg4dnWkSXowUO6ssQKnOV0yMVxDYNIsIrzqTFDGH0= modernc.org/ccgo/v3 v3.16.13 h1:Mkgdzl46i5F/CNR/Kj80Ri59hC8TKAhZrYSaqvkwzUw= modernc.org/ccgo/v3 v3.16.13/go.mod h1:2Quk+5YgpImhPjv2Qsob1DnZ/4som1lJTodubIcoUkY= -modernc.org/httpfs v1.0.0 h1:LtuKNg6JMiaBKVQHKd6Phhvk+2GFp+pUcmDQgRjrds0= -modernc.org/httpfs v1.0.0/go.mod h1:BSkfoMUcahSijQD5J/Vu4UMOxzmEf5SNRwyXC4PJBEw= +modernc.org/ccorpus v1.11.6 h1:J16RXiiqiCgua6+ZvQot4yUuUy8zxgqbqEEUuGPlISk= modernc.org/httpfs v1.0.6 h1:AAgIpFZRXuYnkjftxTAZwMIiwEqAfk8aVB2/oA6nAeM= -modernc.org/libc v1.0.0 h1:MgQgjhJDgugN7makTrP2K503x+vKBy0EIv1o8uSuG0k= -modernc.org/libc v1.0.0/go.mod h1:iulSAj8W71uuiT8V3cOzJfRvrhNMz2kawtuJy18EEE4= modernc.org/libc v1.24.1 h1:uvJSeCKL/AgzBo2yYIPPTy82v21KgGnizcGYfBHaNuM= modernc.org/libc v1.24.1/go.mod h1:FmfO1RLrU3MHJfyi9eYYmZBfi/R+tqZ6+hQ3yQQUkak= -modernc.org/mathutil v1.1.1 h1:FeylZSVX8S+58VsyJlkEj2bcpdytmp9MmDKZkKx8OIE= -modernc.org/mathutil v1.1.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= modernc.org/mathutil v1.5.0 h1:rV0Ko/6SfM+8G+yKiyI830l3Wuz1zRutdslNoQ0kfiQ= modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= -modernc.org/memory v1.0.0 h1:Tm1p6vBp/U/SGR9/EeFhMvGzaVpUWeePopZhhIpW2YE= -modernc.org/memory v1.0.0/go.mod h1:TXr4iJDvK3g0hW+sV+Kohu7BoeHfqw7QEFZWkBExdZc= modernc.org/memory v1.6.0 h1:i6mzavxrE9a30whzMfwf7XWVODx2r5OYXvU46cirX7o= modernc.org/memory v1.6.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= -modernc.org/sqlite v1.4.0 h1:rpQmt8iwSzPF9DuPRJ5EvesY+FLUohuaMTW1TJ9mtvY= -modernc.org/sqlite v1.4.0/go.mod h1:XnAfpewk8pgSsRFCaAMiAI4ljY/XHANDdf0Jxc0h5R4= modernc.org/sqlite v1.26.0 h1:SocQdLRSYlA8W99V8YH0NES75thx19d9sB/aFc4R8Lw= modernc.org/sqlite v1.26.0/go.mod h1:FL3pVXie73rg3Rii6V/u5BoHlSoyeZeIgKZEgHARyCU= modernc.org/strutil v1.1.3 h1:fNMm+oJklMGYfU9Ylcywl0CO5O6nTfaowNsh2wpPjzY= modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= -modernc.org/tcl v1.1.0 h1:rOb4Dtcf0aidHBu8Ctz3FkW+PQpgCrChEIQ9+LUPst0= -modernc.org/tcl v1.1.0/go.mod h1:8qvhdwj80wWqMugFAW2sduRIsdWBKOmxu+VwCXfE1X4= modernc.org/tcl v1.15.2 h1:C4ybAYCGJw968e+Me18oW55kD/FexcHbqH2xak1ROSY= modernc.org/token v1.0.1 h1:A3qvTqOwexpfZZeyI0FeGPDlSWX5pjZu9hF4lU+EKWg= modernc.org/token v1.0.1/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= +modernc.org/z v1.7.3 h1:zDJf6iHjrnB+WRD88stbXokugjyc0/pB91ri1gO6LZY=