Commit Graph

1073 Commits

Author SHA1 Message Date
Yasuhiro Matsumoto
e1557be6ce batch row column fetches in Next 2026-04-03 12:47:30 +09:00
mattn
cc39db7160 Merge pull request #1382 from mattn/codex/sqlite3-bind-fastpath
[codex] optimize sqlite bind fast path
2026-04-03 12:00:00 +09:00
Yasuhiro Matsumoto
9a908a9fd0 optimize sqlite bind fast path 2026-04-03 11:47:49 +09:00
mattn
edadafaf61 Merge pull request #1381 from mattn/eliminate-bounds-checks
Eliminate unnecessary bounds checks in hot paths
2026-03-30 12:57:50 +09:00
Yasuhiro Matsumoto
8f9f86ea43 Eliminate unnecessary bounds checks in hot paths
- Replace len(args[start:start+na]) > 0 with na > 0 to avoid slice bounds check
- Use range loops instead of manual index loops for cols/decltype slices
- Use range variable v.Ordinal instead of re-indexing args[i].Ordinal
- Add bounds hint for decltype access in nextSyncLocked loop
2026-03-30 12:48:09 +09:00
mattn
0d2388125f Merge pull request #1379 from theimpostor/pr-1322-missing-constraint-op-types
Add missing virtual table constraint op constants
2026-03-19 13:39:43 +09:00
theimpostor
84bdc43851 add missing index constraint op types 2026-03-18 17:40:17 -05:00
mattn
57e50071ab Merge pull request #1313 from Jaculabilis/json-example
Fix json example
2026-03-17 02:31:23 +09:00
Yasuhiro Matsumoto
bb8d0b2a05 Bump Go test matrix versions from 1.23-1.25 to 1.24-1.26 2026-03-17 02:19:02 +09:00
Yasuhiro Matsumoto
bc7436edad Bump GitHub Actions versions to latest 2026-03-17 02:19:02 +09:00
Yasuhiro Matsumoto
0f12d4e815 Ensure Close always removes runtime finalizer to prevent memory leak
Fixes #1319
2026-03-17 02:19:02 +09:00
Yasuhiro Matsumoto
d71eda82d4 Fix upgrade.sh: add already-up-to-date check and fix changelog URL format 2026-03-17 01:41:11 +09:00
Yasuhiro Matsumoto
4ea2a9fb44 Upgrade SQLite to version 3051003 2026-03-17 01:41:11 +09:00
Yasuhiro Matsumoto
8c99a68554 Call sqlite3_clear_bindings() in bind() to reset parameters
Closes #1063
2026-03-17 01:23:59 +09:00
Yasuhiro Matsumoto
5a1f4d3045 use unsafe.Slice 2026-03-04 09:27:38 +09:00
Yasuhiro Matsumoto
8366a001c1 create pull-request 2026-03-04 09:14:31 +09:00
Yasuhiro Matsumoto
208733130e add script to create pull-request 2026-01-16 17:19:36 +09:00
Yasuhiro Matsumoto
a5108832c7 Upgrade SQLite to version 3051002 2026-01-16 17:19:17 +09:00
Daniël Sonck
dce6b34a89 Add percentile extension 2026-01-01 23:03:41 +09:00
Yasuhiro Matsumoto
3c885a9512 Upgrade SQLite to version 3051001 2026-01-01 23:00:27 +09:00
Yasuhiro Matsumoto
3e773a9be5 update github workflows 2026-01-01 22:56:17 +09:00
Yasuhiro Matsumoto
2f6a2bbbfd fix upgrade script 2026-01-01 22:44:09 +09:00
Yasuhiro Matsumoto
aa7cdd300f update upgrade script 2026-01-01 22:32:40 +09:00
nautaa
a66908a543 use quote include instead of angled include for sqlite3-binding.h 2025-11-10 13:41:25 +09:00
Yasuhiro Matsumoto
8bf7a8a844 update amalgamation code 2025-08-14 21:57:30 +09:00
Eray Tufan
2e165e0718 fix syntax error 2025-08-11 23:08:54 +09:00
Yasuhiro Matsumoto
e63a0c3f5b fix test 2025-07-30 20:51:05 +09:00
Yasuhiro Matsumoto
a9775d4d98 return error 2025-07-30 20:51:05 +09:00
Yasuhiro Matsumoto
c857a95a18 drop call of AuthEnabled() 2025-07-30 20:51:05 +09:00
Yasuhiro Matsumoto
eb86f084da check authEnabled 2025-07-30 20:51:05 +09:00
Yasuhiro Matsumoto
4372bf2fb0 enable test for sqlite_userauth but it is dropped at least 2025-07-30 20:51:05 +09:00
Yasuhiro Matsumoto
69a843e67f fix GitHub workflow 2025-07-30 20:51:05 +09:00
Yasuhiro Matsumoto
4c1ac1eb24 fix GitHub workflow 2025-07-30 20:51:05 +09:00
Yasuhiro Matsumoto
a8be3f8183 fix GitHub workflow 2025-07-30 20:51:05 +09:00
Yasuhiro Matsumoto
37998ab68d drop tests for userauth 2025-07-30 20:51:05 +09:00
Yasuhiro Matsumoto
5629687fbd update GitHub workflows 2025-07-30 20:51:05 +09:00
Yasuhiro Matsumoto
90f0aff35d drop userauth feature 2025-07-30 20:51:05 +09:00
Yasuhiro Matsumoto
d8fd268206 drop userauth implementation
closes #1341
2025-07-30 20:51:05 +09:00
Yasuhiro Matsumoto
8c283ed77e Update amalgamation code to 3.50.3 2025-07-24 22:20:51 +09:00
Yasuhiro Matsumoto
f76bae4b00 upgrade amalgamation code 2025-04-16 22:41:38 +09:00
Jonathan Stacks
65302b0708 Add ability to set an int64 file control (#1298)
* Add ability to set an int64 file control

* Update documentation

* Remove duplicate err check in test

* Update sqlite3.go

Co-authored-by: rittneje <rittneje@gmail.com>

---------

Co-authored-by: rittneje <rittneje@gmail.com>
2025-04-05 15:42:20 -04:00
Yasuhiro Matsumoto
8d69329881 revert #1259 2025-04-03 01:27:34 +09:00
justinsb
9794660801 docs: clarify GCP section
GCP (at least Google Compute Engine) is a VM, and does not have restrictions relating to gcc.

Also it appears that this whole section refers to general compiling, rather than compiling on GCP.
2025-04-01 22:39:11 +09:00
Halil ibrahim Onay
b9f4d8c067 chore: Fix memory leak in callbackRetText function 2025-04-01 22:33:32 +09:00
Tim Van Baak
cff37b40bd Fix json example
Because of sqlite's flexible typing, even though the column was declared as jsonb, the values are stored as the TEXT-typed json because they're converted to strings by Value/Scan. If the table is strict with a BLOB column, the example fails because of the type mismatch. This can be fixed by using the `jsonb()` function to convert incoming string-typed json and the `json()` function to convert outgoing binary-typed jsonb. The example is expanded to show both of these approaches.

Note that both approaches use the same string-typed marshalling functions because the conversion to jsonb occurs within sqlite3, not within the Go code. SQLite docs state that the binary format is internal and applications shouldn't try to generate it: https://sqlite.org/json1.html#jsonb
2025-01-21 06:42:16 -08:00
nina
7658c06970 Fix sqlite3_opt_unlock_notify with USE_LIBSQLITE3 (#1262)
A valid sqlite header must always be included (like in the other
files) but sqlite3-binding.h explicitly guards against the system
library case.
2024-12-08 23:36:34 -05:00
Charlie Vieth
c61eeb5d1d remove superfluous use of runtime.SetFinalizer on SQLiteRows
The commit removes the use of runtime.SetFinalizer to finalize
SQLiteRows since only serves to close the associated SQLiteStmt which
already has a registered finalizer.

It also fixes a race and potential panic in SQLiteRows.Close around the
SQLiteRows.s field (*SQLiteStmt) which is accessed without a mutex being
held, but modified with it held (null'd out). Further the mutex we are
holding is that of the SQLiteStmt so a subsequent call to Close will
cause a panic sine it'll attempt to dereference a nil field. The fix
here is to add a mutex for closing to SQLiteRows.

Since we now also set the s field to nil when closing this commit
removes the "closed" field (since checking if s is nil is the same) and
also changes the type of "nc" (number of columns) to an int32 so that we
can pack the nc and cls fields, and add the close mutex without making
the struct any bigger.

```
goos: darwin
goarch: arm64
pkg: github.com/charlievieth/go-sqlite3
cpu: Apple M4 Pro
                                          │   x1.txt    │               x4.txt                │
                                          │   sec/op    │   sec/op     vs base                │
Suite/BenchmarkExec/Params-14               719.2n ± 2%   716.9n ± 1%        ~ (p=0.897 n=10)
Suite/BenchmarkExec/NoParams-14             506.5n ± 3%   500.1n ± 0%   -1.25% (p=0.002 n=10)
Suite/BenchmarkExecContext/Params-14        1.584µ ± 0%   1.567µ ± 1%   -1.07% (p=0.007 n=10)
Suite/BenchmarkExecContext/NoParams-14      1.524µ ± 1%   1.524µ ± 1%        ~ (p=0.539 n=10)
Suite/BenchmarkExecStep-14                  443.9µ ± 3%   441.4µ ± 0%   -0.55% (p=0.011 n=10)
Suite/BenchmarkExecContextStep-14           447.8µ ± 1%   442.9µ ± 0%   -1.10% (p=0.000 n=10)
Suite/BenchmarkExecTx-14                    1.643µ ± 1%   1.640µ ± 0%        ~ (p=0.642 n=10)
Suite/BenchmarkQuery-14                     1.968µ ± 3%   1.821µ ± 1%   -7.52% (p=0.000 n=10)
Suite/BenchmarkQuerySimple-14               1.207µ ± 2%   1.040µ ± 1%  -13.84% (p=0.000 n=10)
Suite/BenchmarkQueryContext/Background-14   2.400µ ± 1%   2.320µ ± 0%   -3.31% (p=0.000 n=10)
Suite/BenchmarkQueryContext/WithCancel-14   8.847µ ± 5%   8.512µ ± 4%   -3.79% (p=0.007 n=10)
Suite/BenchmarkParams-14                    2.131µ ± 2%   1.967µ ± 1%   -7.70% (p=0.000 n=10)
Suite/BenchmarkStmt-14                      1.444µ ± 1%   1.359µ ± 1%   -5.89% (p=0.000 n=10)
Suite/BenchmarkRows-14                      61.57µ ± 1%   60.24µ ± 1%   -2.16% (p=0.000 n=10)
Suite/BenchmarkStmtRows-14                  60.15µ ± 1%   59.08µ ± 1%   -1.78% (p=0.000 n=10)
Suite/BenchmarkQueryParallel-14             960.9n ± 1%   420.8n ± 2%  -56.21% (p=0.000 n=10)
geomean                                     4.795µ        4.430µ        -7.62%
```
2024-12-09 13:00:34 +09:00
Sam Jewell
ab13d63ae7 Remove suggestion that CGO isn't always needed (#1290)
Fixes #855
2024-12-04 20:38:50 -05:00
Jonathan Stacks
348128fdcf Upgrade upload-artifact action
action/upload-artifact@v1 has been deprecated for a while. It seems like GitHub Actions
will now cancel workflows if it is still using v1 of the action. This
upgrades to the latest v4 of the action.

See https://github.blog/news-insights/product-news/get-started-with-v4-of-github-actions-artifacts/
for details.
2024-11-27 07:51:01 +09:00
Yasuhiro Matsumoto
82bc911e85 close statement when missing query arguments
fixes #1280
2024-10-04 23:58:44 +09:00