Preston Thorpe
231282a5be
Merge 'Simulator Roadmap' from Alperen Keleş
...
This PR is a working doc on a roadmap for the simulator. @pedrocarlo
@LeMikaelF please take a look.
Reviewed-by: Preston Thorpe <preston@turso.tech>
Closes #3954
2025-12-05 13:27:57 -05:00
PThorpe92
a9fc469b3a
Update COMPAT.md
2025-12-02 15:42:41 -05:00
Nikita Sivukhin
b08374be46
support table_xinfo pragma
2025-11-20 17:38:10 +04:00
alpaylan
4aac076400
wip: add simulator roadmap
2025-11-13 14:25:17 -05:00
PThorpe92
b443b09516
Remove VRollback and VCommit as they are unused opcodes in sqlite
2025-11-09 11:27:09 -05:00
PThorpe92
40f7ddb28e
Add VBegin, VRename, VRollback and VCommit opcodes to COMPAT.md
2025-11-09 11:07:42 -05:00
Jussi Saurio
ca70df21ac
Update COMPAT.md
2025-10-28 13:11:12 +02:00
Jussi Saurio
171bcd83ec
COMPAT.MD: note about WINDOW functions
2025-10-13 10:16:13 +03:00
PThorpe92
b40e784903
Update COMPAT.md, add fk related opcodes
2025-10-07 16:22:15 -04:00
Preston Thorpe
d44a1f8bca
Merge 'Implement json_tree' from Mikaël Francoeur
...
Build & publish @tursodatabase/database / db-bindings-x86_64-pc-windows-msvc - node@20 (push) Waiting to run
Build & publish @tursodatabase/database / db-bindings-x86_64-unknown-linux-gnu - node@20 (push) Waiting to run
Build & publish @tursodatabase/database / sync-bindings-aarch64-apple-darwin - node@20 (push) Waiting to run
Build & publish @tursodatabase/database / sync-bindings-aarch64-unknown-linux-gnu - node@20 (push) Waiting to run
Build & publish @tursodatabase/database / sync-bindings-wasm32-wasip1-threads - node@20 (push) Waiting to run
Build & publish @tursodatabase/database / sync-bindings-x86_64-pc-windows-msvc - node@20 (push) Waiting to run
Build & publish @tursodatabase/database / sync-bindings-x86_64-unknown-linux-gnu - node@20 (push) Waiting to run
Build & publish @tursodatabase/database / Test DB bindings on Linux-x64-gnu - node@20 (push) Blocked by required conditions
Build & publish @tursodatabase/database / Test DB bindings on browser@20 (push) Blocked by required conditions
Build & publish @tursodatabase/database / Publish (push) Blocked by required conditions
Python / configure-strategy (push) Waiting to run
Python / test (push) Blocked by required conditions
Python / lint (push) Waiting to run
Python / linux (x86_64) (push) Waiting to run
Python / macos-arm64 (aarch64) (push) Waiting to run
Python / sdist (push) Waiting to run
Python / Release (push) Blocked by required conditions
Rust / cargo-fmt-check (push) Waiting to run
Rust / build-native (blacksmith-4vcpu-ubuntu-2404) (push) Waiting to run
Rust / build-native (macos-latest) (push) Waiting to run
Rust / test-sqlite (push) Waiting to run
Rust Benchmarks+Nyrkiö / bench (push) Waiting to run
Rust Benchmarks+Nyrkiö / tpc-h (push) Waiting to run
Rust Benchmarks+Nyrkiö / vfs-bench-compile (push) Waiting to run
Rust / build-native (windows-latest) (push) Waiting to run
Rust / clippy (push) Waiting to run
Rust / simulator (push) Waiting to run
Rust / test-limbo (push) Waiting to run
Rust Benchmarks+Nyrkiö / clickbench (push) Waiting to run
Rust Benchmarks+Nyrkiö / tpc-h-criterion (push) Waiting to run
This PR implements the `json_tree` table-valued function.
It's not 100% compatible with SQLite, because SQLite does some iffy
things with the `key` and `path` columns. I started a
[thread](https://www.sqlite.org/forum/forumpost/48f5763d8c ) on their
forum and I linked it to the disabled tests in `json.test`.
Reviewed-by: Preston Thorpe <preston@turso.tech>
Closes #3256
2025-09-25 16:45:44 -04:00
Pavan-Nambi
49d5141f2d
Merge remote-tracking branch 'origin/main' into cdc_fail_autoincrement
2025-09-24 18:06:02 +05:30
PThorpe92
7dccff0bee
Update COMPAT.md, add sequence and sequencetest opcodes
2025-09-23 22:32:22 -04:00
Mikaël Francoeur
8cc206e748
compat
2025-09-23 14:23:42 -04:00
Mikaël Francoeur
3e915d9868
implement json_tree
2025-09-23 14:22:02 -04:00
Pavan-Nambi
0de92cd7fb
update compat.md that we have memmax
2025-09-20 10:54:59 +05:30
Piotr Rzysko
b911e80607
Add AggValue instruction
...
Adds the AggValue instruction, which computes the current aggregate
result and writes it to a dedicated destination register.
Unlike AggFinal, it does not overwrite or clear the accumulator
register. This makes it possible to retrieve aggregate results multiple
times—needed when processing window functions—while preserving the
accumulator state.
2025-09-13 10:49:14 +02:00
Piotr Rzysko
867bef55d8
Add ResetSorter instruction
...
This instruction isn't used yet, but it will be needed for window
functions, since they heavily rely on ephemeral tables.
2025-09-13 10:44:56 +02:00
Piotr Rzysko
ea9599681e
Add OpenDup instruction
...
The instruction isn’t used yet, but it’ll be needed for window functions,
since they heavily rely on ephemeral tables.
2025-09-13 10:35:33 +02:00
Pekka Enberg
c620a15a55
Merge 'core: Support ceiling modifier in datetime' from Ceferino Patino
...
Resolves #2677
- Implements the modifier for Floor on the datetime object.
- Implements the modifier for Ceiling on the datetime object.
- Includes additional testing changes in testing/scalar-functions-
datetime.test to test the sql functionality.
Consolidation PR of #2678 and #2679 since the functions ended up being
much more complicated than I initially thought and had to be done in a
single PR.
Closes #2757
2025-09-10 14:46:07 +03:00
Mikaël Francoeur
e6d3d6ea54
1-arg json_each implementation
2025-09-05 14:47:40 -04:00
Pekka Enberg
12cf4d2e72
core: Make strict schema support experimental
...
It's not tested properly so let's mark it as experimental for now.
Fixes #2775
2025-09-02 16:40:02 +03:00
PThorpe92
761da801e8
Add ON CONFLICT DO to COMPAT.md
2025-08-29 20:58:44 -04:00
PThorpe92
8257496411
Update COMPAT.md to remove CREATE INDEX default disabled
2025-08-29 20:44:09 -04:00
Pekka Enberg
44ed4d562f
core: Initial pass on synchronous pragma
...
This adds support for "OFF" and "FULL" (default) synchronous modes. As
future work, we need to add NORMAL and EXTRA as well because
applications expect them.
2025-08-28 16:02:41 +03:00
C4 Patino
9bda897118
chore: marked datetime ceiling modifier as completed in COMPAT.md
2025-08-23 22:59:08 -05:00
Jussi Saurio
d7186c7d7b
Merge 'Add support for unlikely(X)' from bit-aloo
...
Implements the unlikely(X) function. Removes runtime implementations of
likely(), unlikely() and likelihood(), replacing them with panics if
they reach the VDBE.
Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>
Closes #2559
2025-08-14 10:56:27 +03:00
Glauber Costa
5ab6f78f6b
Implement views
...
Views (non materialized) are relatively simple, since they are just
query aliases.
We can expand them as if they were subqueries.
2025-08-13 14:14:03 -05:00
bit-aloo
71525c90e5
update compat.md
2025-08-12 16:27:58 +05:30
bit-aloo
e165deb09d
update compact md
2025-08-11 10:03:58 +05:30
Pekka Enberg
0f9d0cf519
Merge branch 'main' into 2025-08-07-add-query-only-pragma
2025-08-08 07:41:38 +03:00
bit-aloo
ee483ce4e9
update compat.md with query_only pragma
2025-08-07 23:50:18 +05:30
Glauber Costa
071330a739
implement the JournalMode vdbe instruction
...
We do this already, but not through any opcode.
Move it to an opcode for compatibility reasons.
2025-08-06 19:30:19 -05:00
Glauber Costa
f36974f086
implement the MaxPgCount opcode
...
It is used by the pragma max_page_count, which is also implemented.
2025-08-06 13:20:15 -05:00
Jussi Saurio
aaa9ed1d9f
Merge 'Add regexp capture' from bit-aloo
...
JavaScript / stable - wasm32-wasip1-threads - node@20 (push) Waiting to run
JavaScript / stable - aarch64-apple-darwin - node@20 (push) Waiting to run
JavaScript / stable - x86_64-unknown-linux-gnu - node@20 (push) Waiting to run
JavaScript / Test bindings on Linux-x64-gnu - node@20 (push) Blocked by required conditions
JavaScript / Build universal macOS binary (push) Blocked by required conditions
JavaScript / Publish (push) Blocked by required conditions
JavaScript / stable - x86_64-apple-darwin - node@20 (push) Waiting to run
JavaScript / stable - x86_64-pc-windows-msvc - node@20 (push) Waiting to run
JavaScript / Test bindings on x86_64-apple-darwin - node@20 (push) Blocked by required conditions
Python / configure-strategy (push) Waiting to run
Python / test (push) Blocked by required conditions
Python / lint (push) Waiting to run
Python / linux (x86_64) (push) Waiting to run
Python / macos-x86_64 (x86_64) (push) Waiting to run
Python / macos-arm64 (aarch64) (push) Waiting to run
Python / sdist (push) Waiting to run
Python / Release (push) Blocked by required conditions
Rust / cargo-fmt-check (push) Waiting to run
Rust / build-native (blacksmith-4vcpu-ubuntu-2404) (push) Waiting to run
Rust / build-native (macos-latest) (push) Waiting to run
Rust / build-native (windows-latest) (push) Waiting to run
Rust / clippy (push) Waiting to run
Rust / simulator (push) Waiting to run
Rust / test-limbo (push) Waiting to run
Rust / test-sqlite (push) Waiting to run
Rust Benchmarks+Nyrkiö / bench (push) Waiting to run
Rust Benchmarks+Nyrkiö / clickbench (push) Waiting to run
Rust Benchmarks+Nyrkiö / tpc-h-criterion (push) Waiting to run
Rust Benchmarks+Nyrkiö / tpc-h (push) Waiting to run
Rust Benchmarks+Nyrkiö / vfs-bench-compile (push) Waiting to run
This PR adds RegExp Capture to regexp module
Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>
Closes #2465
2025-08-06 12:13:19 +03:00
Glauber Costa
d1be7ad0bb
implement the collseq bytecode instruction
...
SQLite generates those in aggregations like min / max with collation
information either in the table definition or in the column expression.
We currently generate the wrong result here, and properly generating the
bytecode instruction fixes it.
2025-08-05 13:49:04 -05:00
bit-aloo
eff096273c
update compat.md
2025-08-05 20:54:55 +05:30
Glauber Costa
0506da70ed
more compat police
...
* Affinity is already present
* InsertInt is not a thing
* String is never generated directly, it is a second-execution
optimization for String8 so the size doesn't have to be recomputed,
but we always store the size anyway.
2025-07-31 10:46:12 -05:00
Glauber Costa
9e8ba5263b
Implement the AddImm opcode
...
It is a simple opcode. The hard part was finding a sqlite statement
that uses it =)
2025-07-31 08:08:07 -05:00
PThorpe92
07137c7aaf
Merge 'Implement the Cast opcode' from Glauber Costa
...
Our compat matrix mentions a couple of opcodes: ToInt, ToBlob, etc.
Those opcodes do not exist.
Instead, there is a single Cast opcode, that takes the affinity as a
parameter.
Currently we just call a function when we need to cast. This PR fixes
the compat file, implements the cast opcode, and in at least one
instance, when explicitly using the CAST keyword, uses that opcode
instead of a function in the generated bytecode.
Reviewed-by: Preston Thorpe (@PThorpe92)
Reviewed-by: Preston Thorpe (@PThorpe92)
Closes #2352
2025-07-30 22:32:09 -04:00
Glauber Costa
caec3f7c51
remove non-existent opcode
...
$ egrep -rI "define OP" sqlite3.c | grep Cookie
sqlite3.c:#define OP_ReadCookie 99
sqlite3.c:#define OP_SetCookie 100
2025-07-30 20:50:00 -05:00
Glauber Costa
4bd1582e7d
Implement the Cast opcode
...
Our compat matrix mentions a couple of opcodes: ToInt, ToBlob, etc.
Those opcodes do not exist.
Instead, there is a single Cast opcode, that takes the affinity as a
parameter.
Currently we just call a function when we need to cast. This PR fixes
the compat file, implements the cast opcode, and in at least one
instance, when explicitly using the CAST keyword, uses that opcode
instead of a function in the generated bytecode.
2025-07-30 20:44:54 -05:00
bit-aloo
6f45cb9770
update vector slice to adhere to start..end and not start, length
2025-07-30 14:10:43 +05:30
bit-aloo
96a99ca48a
rename subvector to vector_slice
2025-07-30 13:34:49 +05:30
bit-aloo
b5d46803b5
update compact.md with vector concat and subvector listings
2025-07-30 09:51:08 +05:30
Pekka Enberg
a2a31a520f
Remove CreateTable from COMPAT.md
...
JavaScript / Test bindings on x86_64-apple-darwin - node@20 (push) Blocked by required conditions
JavaScript / Test bindings on Linux-x64-gnu - node@20 (push) Blocked by required conditions
JavaScript / stable - aarch64-apple-darwin - node@20 (push) Waiting to run
JavaScript / stable - x86_64-apple-darwin - node@20 (push) Waiting to run
JavaScript / stable - x86_64-pc-windows-msvc - node@20 (push) Waiting to run
JavaScript / stable - x86_64-unknown-linux-gnu - node@20 (push) Waiting to run
JavaScript / Build universal macOS binary (push) Blocked by required conditions
JavaScript / Publish (push) Blocked by required conditions
Python / configure-strategy (push) Waiting to run
Python / lint (push) Waiting to run
Python / test (push) Blocked by required conditions
Python / linux (x86_64) (push) Waiting to run
Python / macos-x86_64 (x86_64) (push) Waiting to run
Python / macos-arm64 (aarch64) (push) Waiting to run
Python / sdist (push) Waiting to run
Python / Release (push) Blocked by required conditions
Rust / cargo-fmt-check (push) Waiting to run
Rust / build-native (blacksmith-4vcpu-ubuntu-2404) (push) Waiting to run
Rust / build-native (macos-latest) (push) Waiting to run
Rust / build-native (windows-latest) (push) Waiting to run
Rust / clippy (push) Waiting to run
Rust / build-wasm (push) Waiting to run
Rust / simulator (push) Waiting to run
Rust Benchmarks+Nyrkiö / tpc-h-criterion (push) Waiting to run
Rust Benchmarks+Nyrkiö / tpc-h (push) Waiting to run
Rust / test-limbo (push) Waiting to run
Rust / test-sqlite (push) Waiting to run
Rust Benchmarks+Nyrkiö / bench (push) Waiting to run
Rust Benchmarks+Nyrkiö / clickbench (push) Waiting to run
Rust Benchmarks+Nyrkiö / vfs-bench-compile (push) Waiting to run
There is no such opcode.
2025-07-27 09:12:31 +03:00
Pekka Enberg
6bf6cc28e4
Merge 'Implement the Returning statement for inserts and updates' from Glauber Costa
...
They are very similar. DELETE is very different, so that one we'll do it
later.
Closes #2276
2025-07-27 09:11:16 +03:00
PThorpe92
60c37eb036
Merge 'implement the pragma encoding' from Glauber Costa
...
Do not allow setting it. That ship has sailed around 2005.
Reviewed-by: Preston Thorpe (@PThorpe92)
Closes #2282
2025-07-26 21:31:27 -04:00
PThorpe92
22df76d37d
Merge 'compat police' from Glauber Costa
...
All those opcodes seem implemented.
Reviewed-by: Preston Thorpe (@PThorpe92)
Closes #2284
2025-07-26 21:28:28 -04:00
Glauber Costa
421ab44cf2
compat police
...
All those opcodes seem implemented.
2025-07-26 20:06:21 -05:00
Glauber Costa
f0b1abd567
remove upsert statement from COMPAT.md
...
There's no such statement in SQLite.
2025-07-26 19:39:32 -05:00