From 15e0bf6e5a57e60edf4a576db2dcb9bc07a163bf Mon Sep 17 00:00:00 2001 From: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Date: Sat, 22 Jun 2024 09:59:29 +0000 Subject: [PATCH] [chore] update github.com/ncruces/go-sqlite3 -> v0.16.3 (#3029) --- go.mod | 2 +- go.sum | 4 +-- .../github.com/ncruces/go-sqlite3/README.md | 6 ++-- .../ncruces/go-sqlite3/driver/driver.go | 33 ++++++++++-------- .../ncruces/go-sqlite3/embed/README.md | 5 ++- .../ncruces/go-sqlite3/embed/sqlite3.wasm | Bin 1365178 -> 1365234 bytes .../ncruces/go-sqlite3/vfs/const.go | 1 + .../ncruces/go-sqlite3/vfs/memdb/README.md | 2 +- .../ncruces/go-sqlite3/vfs/os_bsd.go | 9 ++++- .../ncruces/go-sqlite3/vfs/os_unix_lock.go | 2 +- .../ncruces/go-sqlite3/vfs/shm_bsd.go | 3 +- vendor/github.com/ncruces/go-sqlite3/vtab.go | 31 +++++++++++----- vendor/modules.txt | 2 +- 13 files changed, 66 insertions(+), 34 deletions(-) diff --git a/go.mod b/go.mod index 1d78b0700..0846e0375 100644 --- a/go.mod +++ b/go.mod @@ -45,7 +45,7 @@ require ( github.com/miekg/dns v1.1.61 github.com/minio/minio-go/v7 v7.0.71 github.com/mitchellh/mapstructure v1.5.0 - github.com/ncruces/go-sqlite3 v0.16.2 + github.com/ncruces/go-sqlite3 v0.16.3 github.com/oklog/ulid v1.3.1 github.com/prometheus/client_golang v1.19.1 github.com/spf13/cobra v1.8.1 diff --git a/go.sum b/go.sum index d87b9a721..6d0bfa0c0 100644 --- a/go.sum +++ b/go.sum @@ -441,8 +441,8 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/moul/http2curl v1.0.0 h1:dRMWoAtb+ePxMlLkrCbAqh4TlPHXvoGUSQ323/9Zahs= github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= -github.com/ncruces/go-sqlite3 v0.16.2 h1:HesVRr0BC6QSGSEQfEXOntFWS9wd4Z8ms4nJzfUv4Rg= -github.com/ncruces/go-sqlite3 v0.16.2/go.mod h1:wkUIvOrAjFQnefVlivJfcowKUcfMHs4mvLfhVanzHHI= +github.com/ncruces/go-sqlite3 v0.16.3 h1:Ky0denOdmAGOoCE6lQlw6GCJNMD8gTikNWe8rpu+Gjc= +github.com/ncruces/go-sqlite3 v0.16.3/go.mod h1:sAU/vQwBmZ2hq5BlW/KTzqRFizL43bv2JQoBLgXhcMI= github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4= github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls= github.com/ncruces/julianday v1.0.0 h1:fH0OKwa7NWvniGQtxdJRxAgkBMolni2BjDHaWTxqt7M= diff --git a/vendor/github.com/ncruces/go-sqlite3/README.md b/vendor/github.com/ncruces/go-sqlite3/README.md index c31414724..25b2ccbe4 100644 --- a/vendor/github.com/ncruces/go-sqlite3/README.md +++ b/vendor/github.com/ncruces/go-sqlite3/README.md @@ -33,6 +33,8 @@ Go, wazero and [`x/sys`](https://pkg.go.dev/golang.org/x/sys) are the _only_ run provides the [`array`](https://sqlite.org/carray.html) table-valued function. - [`github.com/ncruces/go-sqlite3/ext/blobio`](https://pkg.go.dev/github.com/ncruces/go-sqlite3/ext/blobio) simplifies [incremental BLOB I/O](https://sqlite.org/c3ref/blob_open.html). +- [`github.com/ncruces/go-sqlite3/ext/bloom`](https://pkg.go.dev/github.com/ncruces/go-sqlite3/ext/bloom) + provides a [Bloom filter](https://github.com/nalgeon/sqlean/issues/27#issuecomment-1002267134) virtual table. - [`github.com/ncruces/go-sqlite3/ext/csv`](https://pkg.go.dev/github.com/ncruces/go-sqlite3/ext/csv) reads [comma-separated values](https://sqlite.org/csv.html). - [`github.com/ncruces/go-sqlite3/ext/fileio`](https://pkg.go.dev/github.com/ncruces/go-sqlite3/ext/fileio) @@ -51,12 +53,12 @@ Go, wazero and [`x/sys`](https://pkg.go.dev/golang.org/x/sys) are the _only_ run provides [Unicode aware](https://sqlite.org/src/dir/ext/icu) functions. - [`github.com/ncruces/go-sqlite3/ext/zorder`](https://pkg.go.dev/github.com/ncruces/go-sqlite3/ext/zorder) maps multidimensional data to one dimension. +- [`github.com/ncruces/go-sqlite3/vfs/adiantum`](https://pkg.go.dev/github.com/ncruces/go-sqlite3/vfs/adiantum) + wraps a VFS to offer encryption at rest. - [`github.com/ncruces/go-sqlite3/vfs/memdb`](https://pkg.go.dev/github.com/ncruces/go-sqlite3/vfs/memdb) implements an in-memory VFS. - [`github.com/ncruces/go-sqlite3/vfs/readervfs`](https://pkg.go.dev/github.com/ncruces/go-sqlite3/vfs/readervfs) implements a VFS for immutable databases. -- [`github.com/ncruces/go-sqlite3/vfs/adiantum`](https://pkg.go.dev/github.com/ncruces/go-sqlite3/vfs/adiantum) - wraps a VFS to offer encryption at rest. ### Advanced features diff --git a/vendor/github.com/ncruces/go-sqlite3/driver/driver.go b/vendor/github.com/ncruces/go-sqlite3/driver/driver.go index b496f76ec..e7863b1b8 100644 --- a/vendor/github.com/ncruces/go-sqlite3/driver/driver.go +++ b/vendor/github.com/ncruces/go-sqlite3/driver/driver.go @@ -229,6 +229,7 @@ func (c *conn) Raw() *sqlite3.Conn { return c.Conn } +// Deprecated: use BeginTx instead. func (c *conn) Begin() (driver.Tx, error) { return c.BeginTx(context.Background(), driver.TxOptions{}) } @@ -301,7 +302,7 @@ func (c *conn) PrepareContext(ctx context.Context, query string) (driver.Stmt, e s.Close() return nil, util.TailErr } - return &stmt{Stmt: s, tmRead: c.tmRead, tmWrite: c.tmWrite}, nil + return &stmt{Stmt: s, tmRead: c.tmRead, tmWrite: c.tmWrite, inputs: -2}, nil } func (c *conn) ExecContext(ctx context.Context, query string, args []driver.NamedValue) (driver.Result, error) { @@ -335,6 +336,7 @@ type stmt struct { *sqlite3.Stmt tmWrite sqlite3.TimeFormat tmRead sqlite3.TimeFormat + inputs int } var ( @@ -345,12 +347,17 @@ type stmt struct { ) func (s *stmt) NumInput() int { + if s.inputs >= -1 { + return s.inputs + } n := s.Stmt.BindCount() for i := 1; i <= n; i++ { if s.Stmt.BindName(i) != "" { + s.inputs = -1 return -1 } } + s.inputs = n return n } @@ -389,12 +396,7 @@ func (s *stmt) QueryContext(ctx context.Context, args []driver.NamedValue) (driv return &rows{ctx: ctx, stmt: s}, nil } -func (s *stmt) setupBindings(args []driver.NamedValue) error { - err := s.Stmt.ClearBindings() - if err != nil { - return err - } - +func (s *stmt) setupBindings(args []driver.NamedValue) (err error) { var ids [3]int for _, arg := range args { ids := ids[:0] @@ -558,19 +560,20 @@ func (r *rows) Next(dest []driver.Value) error { return err } -func (r *rows) decodeTime(i int, v any) (_ time.Time, _ bool) { +func (r *rows) decodeTime(i int, v any) (_ time.Time, ok bool) { if r.tmRead == sqlite3.TimeFormatDefault { - return - } - switch r.declType(i) { - case "DATE", "TIME", "DATETIME", "TIMESTAMP": - // maybe - default: + // handled by maybeTime return } switch v.(type) { case int64, float64, string: - // maybe + // could be a time value + default: + return + } + switch r.declType(i) { + case "DATE", "TIME", "DATETIME", "TIMESTAMP": + // could be a time value default: return } diff --git a/vendor/github.com/ncruces/go-sqlite3/embed/README.md b/vendor/github.com/ncruces/go-sqlite3/embed/README.md index 400fe870a..0156f0176 100644 --- a/vendor/github.com/ncruces/go-sqlite3/embed/README.md +++ b/vendor/github.com/ncruces/go-sqlite3/embed/README.md @@ -24,4 +24,7 @@ See the [configuration options](../sqlite3/sqlite_cfg.h), and [patches](../sqlite3) applied. Built using [`wasi-sdk`](https://github.com/WebAssembly/wasi-sdk), -and [`binaryen`](https://github.com/WebAssembly/binaryen). \ No newline at end of file +and [`binaryen`](https://github.com/WebAssembly/binaryen). + +The build is easily reproducible, and verifiable, using +[Artifact Attestations](https://github.com/ncruces/go-sqlite3/attestations). \ No newline at end of file diff --git a/vendor/github.com/ncruces/go-sqlite3/embed/sqlite3.wasm b/vendor/github.com/ncruces/go-sqlite3/embed/sqlite3.wasm index 2689f773a6c213fe98c56e4700584c25904c5a9e..8dfc7da0c6c642190e25589c6743612dce703195 100644 GIT binary patch delta 3536 zcmaJ@YgAO%89nDRz>EW8m=lBnA{gEesq#<(4OinU8iUeUBDO%P@evSwR3s)cgd`=g z3Ki>zXbfpc#OP{BwHdWdN`ADJ2mxjQ z54lI9LkoLktNV#tp(kXBrn|IVmVy|IeoN+PW%Ol#XqN1EhYf@VXch}r;*Pu>y6n@s z0U<q zH3AKo&^zET1T8-PH}GS87Bm8%wHEyN0|7uFfbt5PJN=^LL;va1VB3KpKnNPR?1<2W z!yS0V5uPs<#SA-&<-=4v?8uT~^s8Y>e6-_-k};!ci#y`J2`1?=h4Rt5P-bA9^ZQWiR4F zOLVW`nt1GeygiS7;Kx$gNQAF+nV@7I6ymD$nqnG2=O6f+)U~8Inx{(Vo3&trNGOe z>=bz4qYWu4OU|W3DQZ0`cY|~DXq+jNqEbOwl*fdsrm85JO*QQ0&~Z@Re3a}`gUudN zRxL&EBAgCmW7t#=qS^waZ*uyD15#A$KIsuoFGRZW6{L&SOA+InZbwwhMY@aAPa@ri zv>y-76}!smJSiwM4NJ3wK=J)q#lC^na!Q9xs9D#8fqa2W*@ zo35PMtXkqh0eCBJ!v4jcRZEwZH+OZZCYB=ixChIqI$cF(-xorvnDc1-D}{?q5&pO) zmLsqNSP876?sOHAd0z*U$^Kw_cr_p9lzE4F#bJQ8z6Q)kArr*s`;Xdv^*j+Q3 zy~pm8lkThxRB0_O&Opu9QmIKUlioIS-5Kcdl&41_eF?X2oyWzq&~F~L*`1>(<^ZZ; ztP@YgSI~F_f-im~#kSljL6Of0T`Z`2L5h{j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