Commit Graph

8806 Commits

Author SHA1 Message Date
Nikita Sivukhin
f3f69598c5 add missing module type for browser package 2025-09-10 03:06:34 +04:00
Preston Thorpe
b2638968fa Merge 'no need QueryStatistics if self.opts.timer is not set' from Lâm Hoàng Phúc
Reviewed-by: Preston Thorpe <preston@turso.tech>

Closes #2980
2025-09-09 17:59:32 -04:00
Jussi Saurio
f5a15bfb3d run 50% of AWS sims with faultless profile 2025-09-10 00:38:37 +03:00
Jussi Saurio
23c55eab6c Make 'faultless' sim profile create some indexes too 2025-09-10 00:32:09 +03:00
Mayank Verma
745feb131f add Connection.reconnect() to serverless driver 2025-09-10 02:17:12 +05:30
Preston Thorpe
d32d19b47f Merge 'Implement 2-args json_each' from Mikaël Francoeur
Reviewed-by: Preston Thorpe <preston@turso.tech>

Closes #2953
2025-09-09 16:43:24 -04:00
PThorpe92
2f4f67efa8 Remove some unused attributes 2025-09-09 16:17:49 -04:00
PThorpe92
02bebf02a5 Remove read_entire_wal_dumb in favor of reading chunks 2025-09-09 16:06:27 -04:00
PThorpe92
cb12a1319d Fix page cache clear method to not re-initialize every slot 2025-09-09 15:55:59 -04:00
Nikita Sivukhin
b49deb64d8 fix lint error 2025-09-09 23:23:32 +04:00
Nikita Sivukhin
62e4f15f22 update update-script to properly handle JS workspace 2025-09-09 22:15:08 +04:00
PThorpe92
8cc4e7f7a0 Fix rollback method to stop using highly inefficient cache::clear_dirty 2025-09-09 13:28:17 -04:00
PThorpe92
f7471a22c0 Fix clear_page_cache method and stop iterating over every entry 2025-09-09 13:25:33 -04:00
PThorpe92
37ec77eec2 Fix read_entire_wal_dumb to prefer streaming read if over 32mb wal file 2025-09-09 13:12:58 -04:00
Pekka Enberg
77e5190113 Turso 0.1.5-pre.4 2025-09-09 19:57:31 +03:00
Pekka Enberg
46c3bb21ad Merge 'Add OPFS support to JavaScript bindings' from Nikita Sivukhin
This PR restructure JS packages and also adds support for OPFS for
tursodatabase in browser.
The new structure looks like this:
1. `@tursodatabase/database-common` - contains abstract JS code for
bindings which depends only on `NativeDB` interface and not on the
explicit native bindings
2. `@tursodatabase/database` - contains native bindings for the database
and re-use `core` package
3. `@tursodatabase/database-browser` - contains bindings for browser
(WASM + OPFS)
As OPFS sync API (which is the most performant one in the web) works
only in the web worker - this PR also make few operations async in order
to run them as `napi-rs` AsyncTask. The following operations became
async in `promise.ts` for node and browser: `pragma` / `exec` / `close`.
Also, as few code pathes during initialization are non-async - they
complicates integration of sync constructor in the browser with OPFS.
So, right now - turso support only `connect` method for browser in non-
memory mode.

Closes #2927
2025-09-09 19:57:19 +03:00
Nikita Sivukhin
318124d864 fight with github ci 2025-09-09 17:36:32 +04:00
Jussi Saurio
cad8be1ed6 Merge 'test/fuzz: add UPDATE/DELETE fuzz test' from Jussi Saurio
Our current UPDATE/DELETE fuzz tests are coupled to the btree and do not
exercise the VDBE code paths at all, so a separate one makes sense.
This test repeats the following:
- Creates one table with n columns
- Creates (0..=n) indexes
- Executes UPDATE/DELETE statements
- Asserts that both sqlite and tursodb have the same DB state after each
stmt

Closes #2978
2025-09-09 15:05:15 +03:00
TcMits
28f23973a4 fix logic 2025-09-09 18:38:33 +07:00
TcMits
463fd75f0b no need QueryStatistics 2025-09-09 18:35:27 +07:00
TcMits
87dd707911 remove garbage files 2025-09-09 17:59:41 +07:00
TcMits
8a72b24c0e add writeln_fmt 2025-09-09 17:57:58 +07:00
TcMits
036235a518 clean 'print_query_result' 2025-09-09 17:41:08 +07:00
Nikita Sivukhin
853afbf4f9 update lock files 2025-09-09 14:33:55 +04:00
Nikita Sivukhin
45c5a96630 fix workflow file 2025-09-09 14:30:59 +04:00
Nikita Sivukhin
f827731727 rename database-core -> database-common 2025-09-09 14:26:21 +04:00
Nikita Sivukhin
1c286193c0 fix CI 2025-09-09 14:20:58 +04:00
Nikita Sivukhin
53e535f535 fix perf 2025-09-09 14:20:35 +04:00
Jussi Saurio
7fe494e888 test/fuzz: add UPDATE/DELETE fuzz test
Our current UPDATE/DELETE fuzz tests are coupled to the btree and do
not exercise the VDBE code paths at all, so a separate one makes sense.

This test repeats the following:

- Creates one table with n columns
- Creates (0..=n) indexes
- Executes UPDATE/DELETE statements
- Asserts that both sqlite and tursodb have the same DB state after each stmt
2025-09-09 13:18:57 +03:00
Nikita Sivukhin
7618dfb519 final adjustments 2025-09-09 14:06:10 +04:00
TcMits
048e72abf5 consume remaining 2025-09-09 16:27:31 +07:00
TcMits
8a6667a829 refactor cli: will write to 2025-09-09 16:23:08 +07:00
Nikita Sivukhin
69aebd5a88 fighting with paths 2025-09-09 12:38:06 +04:00
Nikita Sivukhin
dfea7f0458 fix clippy again 2025-09-09 12:25:40 +04:00
Nikita Sivukhin
e6047cd300 cancel in-progress workflows 2025-09-09 12:23:34 +04:00
Nikita Sivukhin
8b1b71d8b0 fix clippy 2025-09-09 12:21:54 +04:00
Nikita Sivukhin
9f891f891c adjust github workflow 2025-09-09 12:21:29 +04:00
Nikita Sivukhin
816aa8b2bc small fixes 2025-09-09 12:05:41 +04:00
Nikita Sivukhin
8160f4dc04 restructure js bindings 2025-09-09 11:32:38 +04:00
Nikita Sivukhin
96a595069c add browser-specific OPFS file system and few other helpers 2025-09-09 11:32:38 +04:00
Nikita Sivukhin
4d80f8255f use MemoryIO for ephemeral tables for wasm target 2025-09-09 11:20:24 +04:00
Nikita Sivukhin
794440606a sligthly adjust attach to use same IO as main DB (if no custom VFS is specified) 2025-09-09 11:07:26 +04:00
Pekka Enberg
457aaeb1a7 Merge 'optimizer: convert outer join to inner join if possible' from Jussi Saurio
Convert `LEFT JOIN` to `INNER JOIN` when the result of `LEFT JOIN` can
never be different from the result of an `INNER JOIN`
This is useful because 1. it uses less instructions and 2. it allows for
join reordering due to inner join commutativity

Reviewed-by: Preston Thorpe <preston@turso.tech>

Closes #2972
2025-09-09 08:50:31 +03:00
Pekka Enberg
0ef857f98e Merge 'Handle case where null flag is set in op_column' from Jussi Saurio
current code is incorrectly assuming that `index_cursor.rowid()` always
finds a rowid, but this is not the case when `NullRow` has previously
been called.

Reviewed-by: Preston Thorpe <preston@turso.tech>

Closes #2973
2025-09-09 08:49:22 +03:00
Pekka Enberg
c7c669b5af Merge 'Fix merge script to prompt if tests are still in progress' from Preston Thorpe
Closes #2969
2025-09-09 08:49:08 +03:00
Pekka Enberg
b911a87070 Merge 'SQL generation fixes' from Pekka Enberg
Closes #2956
2025-09-09 08:48:51 +03:00
Pekka Enberg
3787126aea Merge 'remove &1' from Lâm Hoàng Phúc
Closes #2976
2025-09-09 08:48:41 +03:00
TcMits
5167096893 remove &1 2025-09-09 11:52:16 +07:00
Jussi Saurio
b01033975a regression test for crash in op_column 2025-09-09 00:11:19 +03:00
Jussi Saurio
c930f28643 Handle case where null flag is set in op_column 2025-09-09 00:00:19 +03:00