Commit Graph

788 Commits

Author SHA1 Message Date
Nikita Sivukhin
cbe0a7708e update tests 2025-08-08 01:21:37 +04:00
Pekka Enberg
bae4406e32 testing/javascript: Enable iterate() test cases 2025-08-07 14:28:34 +03:00
Pekka Enberg
b603ee7062 Merge 'JavaScript improvements' from Pekka Enberg
Closes #2467
2025-08-07 14:01:07 +03:00
Jussi Saurio
eb7fa9693d Merge 'Return error on attempting to drop index associated with PRIMARY KEY and UNIQUE constraints' from
Closes issue #2455. Also includes tests.

Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>

Closes #2461
2025-08-07 09:00:02 +03:00
Preston Thorpe
f55d34a3db Merge 'Fix panic on loading extension on brand new connection' from Preston Thorpe
Closes #2476

Closes #2477
2025-08-06 23:44:38 -04:00
rajajisai
44ba3caaaa Remove miscellaneous characters generated due varying CLI size 2025-08-06 16:02:15 -07:00
PThorpe92
ae99edf4a6 Adjust test to test for behavior of loading extension on brand new connection 2025-08-06 16:55:54 -04: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
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
bit-aloo
84316d9206 fix python lint 2025-08-06 12:02:20 +05:30
Pekka Enberg
ba37e1dc9a testing/javascript: Enable some passing sync test cases 2025-08-06 09:25:22 +03:00
Pekka Enberg
185b7016dd testing/javascript: Enable Statement.all() raw mode test case 2025-08-06 09:23:16 +03:00
Pekka Enberg
3a5e7f8fb6 testing/javascript: Enable Statement.all() test case 2025-08-06 09:22:48 +03:00
Pekka Enberg
53ac67a2be testing/javascript: Add pragma() after close() test case 2025-08-06 09:10:03 +03:00
Pekka Enberg
66b4de1ad9 testing/javascript: Enable exec() after close() test case 2025-08-06 08:08:35 +03:00
Pekka Enberg
cda3375061 testing/javascript: Enable prepare() after close() test case 2025-08-06 07:50:23 +03:00
rajajisai
9ebfed294e Including tests 2025-08-05 21:18:52 -07: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
b26a58f652 update extension.py with regexp_replace test 2025-08-05 20:36:09 +05:30
Piotr Rzysko
99f87c07c1 Support column references in table-valued function arguments
This change extends table-valued function support by allowing arguments
to be column references, not only literals.

Virtual tables can now reject a plan by returning an error from
best_index (e.g., when a TVF argument references a table that appears
later in the join order). The planner using this information excludes
invalid plans during join order search.
2025-08-05 05:48:28 +02:00
Piotr Rzysko
82491ceb6a Integrate virtual tables with optimizer
This change connects virtual tables with the query optimizer.
The optimizer now considers virtual tables during join order search
and invokes their best_index callbacks to determine feasible access
paths.

Currently, this is not a visible change, since none of the existing
extensions return information indicating that a plan is invalid.
2025-08-05 05:48:28 +02:00
Piotr Rzysko
6a4cf02a90 Fix computation of argv_index in best_index
The `filter` methods for extensions affected by this fix expect arguments
to be passed in a specific order. For example, `generate_series` assumes
that if the `start` argument exists, it is always passed to `filter`
first. If `start` does not exist, then `stop` is passed first — but
`stop` must never come before `start`.

Previously, this was not guaranteed: `best_index` relied on constraints
being passed in the order matching `filter`'s expectations.
2025-08-04 19:38:45 +02:00
Piotr Rzysko
79e166d722 Implement xBestIndex for kvstore.c
This is to match Rust kv_store implementation.
2025-08-04 19:25:11 +02:00
Pekka Enberg
5037e2dc0d testing/sqlite3: Update all.test 2025-08-02 13:00:18 +03:00
Pekka Enberg
779b8e0149 testing/sqlite3: Import more join test cases 2025-08-02 12:59:11 +03:00
Pekka Enberg
c7497d55b6 testing/sqlite3: Disable select9.test
...it seems to run forever.
2025-08-02 12:59:11 +03:00
Pekka Enberg
a380e0775d testing/sqlite3: Improve tester.tcl
Improve tester.tcl by adding stubs so that we can run more of the test
suite without the test harness giving up.
2025-08-02 12:59:11 +03:00
rajajisai
d2d7adff9e Including test for parsing large numeric strings as number when an operand is numerican when doing logical comparision 2025-08-01 16:30:32 -07:00
Diego Reis
7c70ac2c4a Fix #2390
Single quotes inside a string literal have to be doubled
2025-08-01 11:37:13 -03:00
Jussi Saurio
c5c3898896 tcl: comment out test that fails due to #2390 2025-08-01 15:45:36 +03:00
Jussi Saurio
86b1232268 chore: enable indexes by default 2025-08-01 15:44:56 +03:00
Pekka Enberg
38dbf75364 Merge 'Implement JavaScript bindings with minimal Rust core' from Pekka Enberg
This rewrites the JavaScript bindings completely by exposing only
primitive operations from Rust NAPI-RS code. For example, there is
prepare(), bind(), and step(), but high level interfaces like all() and
get() are implemented in JavaScript.
We're doing this so that we can implement async interfaces in the
JavaScript layer instead of having to bring in Tokio.

Closes #2372
2025-08-01 13:35:33 +03:00
Pekka Enberg
95b701aa1f testing/javascript: Fix async tests to await 2025-08-01 12:09:05 +03:00
Jussi Saurio
7259751eba Merge 'Support the OFFSET clause for Compound select' from meteorgan
Closes #2376
2025-08-01 10:18:13 +03:00
Jussi Saurio
77666b1eb5 Merge 'Fix parser error for repetition in row values' from Diego Reis
Closes #1948
This PR also adds pretty basic support for [row values in UPDATE stateme
nts](https://sqlite.org/rowvalue.html#row_values_in_update_statements),
but it only accepts expressions like:
```sql
UPDATE t SET (a, b) = (2 + 2, 'joe');
```
While SQLite accepts whole new statements, like:
```sql
UPDATE tab3 
   SET (a,b,c) = (SELECT x,y,z
                    FROM tab4
                   WHERE tab4.w=tab3.d)
 WHERE tab3.e BETWEEN 55 AND 66;
 ```
I noticed we don't explicitly have the concept of row values, maybe
doing some plumbing in that matter could solve it?
If there is a way to implement that with our current infrastructure
(a.k.a skill issue from my side) please comment here.

Closes #2355
2025-08-01 10:17:05 +03:00
meteorgan
6262ff4267 support offset for values 2025-08-01 00:46:46 +08:00
Glauber Costa
9d41fa4489 implement IN patterns for non-conditional SELECT queries
Extracts the core logic of IN from the conditional version, and uses the
conditional metadata to determine the jump. Then Uses the AddImm
operator we just added to force the integer conversion at the end (like
SQLite does).
2025-07-31 08:11:41 -05:00
meteorgan
a0f5554b08 support the OFFSET clause for Compound select 2025-07-31 17:43:54 +08:00
Pekka Enberg
d5c5839ee4 Merge 'Serverless JavaScript driver improvements' from Pekka Enberg
Closes #2349
2025-07-31 10:14:22 +03:00
Diego Reis
31c73f3c9a Add basic support for row values in UPDATE .. SET statements
e.g `.. SET (a, b) = (1, 2)` is equivalent to `.. SET a = 1, b = 2`.

Alongside, to repeated lhs values, `(a, a)`, the last rhs prevail; so
`.. SET (a, a) = (1, 2)` is equivalent to `.. SET a = 2`
2025-07-31 00:08:15 -03:00
PThorpe92
28283e4d1c Fix bench_vfs python script to use fresh db for each run 2025-07-30 19:42:52 -04:00
PThorpe92
efcffd380d Clean up io_uring writev implementation, add iovec and cqe cache 2025-07-30 19:42:52 -04:00
PThorpe92
d189f66328 Add pwritev to wasm/js api 2025-07-30 19:42:48 -04:00
Pekka Enberg
5663dd8c91 testing: Skip in-memory database test for serverless 2025-07-30 21:42:45 +03:00
Jussi Saurio
e128bd477e Merge 'Support VALUES clauses for compound select' from meteorgan
Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>

Closes #2293
2025-07-30 21:34:40 +03:00
Pekka Enberg
6c6d74993c testing/javascript: Clean up after test runs 2025-07-29 16:17:11 +03:00
Pekka Enberg
c39f0e7557 testing/javascript: Add libsql to compatibility test suite 2025-07-29 16:09:49 +03:00
Pekka Enberg
b4dc9bebe0 testing/javascript: Improve error message if TURSO_DATABASE_URL is not set 2025-07-29 16:09:49 +03:00
Pekka Enberg
ee58a0bf32 serverless: Implement Connection.pragma() 2025-07-29 15:00:23 +03:00
Pekka Enberg
cace7abcd2 testing: Add JavaScript compatibility test suite
This is essentially an import of the libSQL test suite.
2025-07-29 14:37:48 +03:00