Commit Graph

745 Commits

Author SHA1 Message Date
PThorpe92
bbb47fd58a Add truncate method to wasm bindings module 2025-07-30 13:48:05 +03:00
Pekka Enberg
2443b8db3c Merge 'bindings/rust: Add Connection::execute_batch()' from Rohith Suresh
Fixes #2184

Closes #2215
2025-07-30 10:19:03 +03:00
Pekka Enberg
d72ba0c153 Merge 'bindings/java: Throw UnsupportedOperationException for unimplemented …' from Pekka Enberg
…methods

Closes #2329
2025-07-29 19:07:51 +03:00
Pekka Enberg
76cbb71b53 Merge 'bindings/rust: return errors instead of vibecoded numbers' from Jussi Saurio
Good vibes only.
Fixes #2327

Closes #2328
2025-07-29 19:07:47 +03:00
RS2007
282222a39f feat: execute_batch working 2025-07-29 21:24:33 +05:30
RS2007
8affc9d436 Prototyping execute_batch 2025-07-29 21:24:22 +05:30
Pekka Enberg
669f02f17c bindings/java: Throw UnsupportedOperationException for unimplemented methods 2025-07-29 17:47:35 +03:00
Jussi Saurio
72bf4a714a bindings/rust: return errors instead of vibecoded numbers 2025-07-29 17:45:15 +03:00
Diego Reis
a35a490188 Force ava tests to run serially 2025-07-29 11:05:37 -03:00
Pekka Enberg
f48b22a52f Merge 'Javascript API improvements' from Pekka Enberg
Various improvements:
- Make promise API the default for `@tursodatabase/turso`
- Add a compatibility test suite for database, serverless, and better-
sqlite3
- Improve serverless driver a bit to be more compatible.

Closes #2322
2025-07-29 15:55:53 +03:00
Pekka Enberg
795081b868 binding/javascript: Promise API by default
The JavaScript API is promise-based by default, but with a `sync`
variant that tracks `better-sqlite3` API for compatibility.
2025-07-29 14:32:37 +03:00
Nikita Sivukhin
76cc8c05a5 add conversion method 2025-07-29 14:41:10 +04:00
Pekka Enberg
8adc807cd7 Merge 'Change function signatures to return IO Completions' from Pedro Muniz
Changes a couple of function signatures to return `Completion`. Also, I
changed `Completion` to be internally `Arc` to abstract the `Arc`
implementation detail, and to be able to attach a `#[must_use]` to the
`Completion` struct, so that cargo check can show us where we are not
tracking completions in the code. I also attached a `#[must_use]` to
`IOResult` so that we can see the places that we are not propagating or
waiting for I/O, demonstrating locations where functions should be
reentrant and are not.
Also, while we are with this refactor in progress I want to relax the
Clippy CI lint on unused_variables.

Closes #2309
2025-07-29 12:41:14 +03:00
Pekka Enberg
94dc780669 Turso 0.1.3 2025-07-29 12:37:18 +03:00
Pekka Enberg
2d2f416e2c Revert "bindings/javascript: Add optional dependencies"
This reverts commit 9d7a77efde. It does
not work because the native packages don't yet exists at that point.
Let's fix the Github workflows instead.
2025-07-29 12:36:12 +03:00
Pekka Enberg
a4737f82bc Turso 0.1.3-pre.10 2025-07-29 12:16:02 +03:00
Pekka Enberg
9d7a77efde bindings/javascript: Add optional dependencies 2025-07-29 12:15:43 +03:00
Pekka Enberg
4f4d321822 Turso 0.1.3-pre.9 2025-07-29 10:58:09 +03:00
Pekka Enberg
ae91a4ab6b bindings/javascript: Add index.js and sqlite3-error.js to package
...won't work without them...
2025-07-29 10:57:36 +03:00
Pekka Enberg
a254f0ecaa Turso 0.1.3-pre.8 2025-07-29 10:13:30 +03:00
Pekka Enberg
57a8c46560 bindings/javascript: Generate native npm packages at publish
Use the `napi create-npm-dirs` command to create the native packages and
remove the manually created ones. Unlocks wasm publish.
2025-07-29 10:00:06 +03:00
Pekka Enberg
04e7d45ac3 Turso 0.1.3-pre.7 2025-07-29 09:15:03 +03:00
Diego Reis
738dec0a72 Address PR's comments
https://github.com/tursodatabase/turso/pull/2307
2025-07-28 17:07:34 -03:00
pedrocarlo
3831e0db39 convert must_use compile warnings to unused_variables to track locations where we need to refactor in the future 2025-07-28 16:09:26 -03:00
pedrocarlo
d30c7d54c8 change all Arc<Completion> to Completion 2025-07-28 15:32:45 -03:00
pedrocarlo
7789c569a0 make Completion implementation contain an inner Arc<CompletionInner> so that we can must_use the Completion struct 2025-07-28 15:31:42 -03:00
pedrocarlo
3104e3fee5 adjust DatabaseStorage trait to return completions 2025-07-28 15:31:42 -03:00
Diego Reis
bab10909c3 Disable extension loading for wasm
We should enable it later when wasm become more mature
2025-07-28 14:49:07 -03:00
Diego Reis
98bec9868b Remove wasm binding
With napi v3 we can compile our javascript binding to wasm, which can
reduce a lot of maintenance overhead and complexity
2025-07-28 14:48:51 -03:00
Pekka Enberg
016c84ed7d Turso 0.1.3-pre.6 2025-07-28 20:21:24 +03:00
Pekka Enberg
e2d4cbbe48 Merge 'core: Enforce shared database object per database file' from Pekka Enberg
We need to ensures that there is a single, shared `Database` object per
a database file. We need because it is not safe to have multiple
independent WAL files open because coordination happens at process-level
POSIX file advisory locks.
Fixes #2267

Reviewed-by: Pere Diaz Bou <pere-altea@homail.com>

Closes #2299
2025-07-28 19:34:35 +03:00
Pekka Enberg
edbbeefed5 bindings/javascript: Fix Database.close()
We need to drop reference to `turso_core::Database` for this to work.
2025-07-28 19:13:53 +03:00
Nikita Sivukhin
976b67a408 fix clippy 2025-07-28 17:27:52 +04:00
Nikita Sivukhin
09b18f6b6e add WAL API methods to the rust bindings and extend result of wal_insert_frame method 2025-07-28 17:20:10 +04:00
Pekka Enberg
551df4ce0d bindings/rust: Fix test_database_persistence_many_frames()
We need to make sure database connection is closed to avoid reusing he
same `Database` object.
2025-07-28 13:04:22 +03:00
Levy A.
cbb618f0ad feat(javascript): add tracing_subscriber 2025-07-27 21:24:39 -03:00
Levy A.
dda5fc22ee refactor(javascript): simplify SqliteError 2025-07-27 21:24:39 -03:00
Pekka Enberg
c7996652fe Merge 'bindings/javascript: Switch to napi v3' from Diego Reis
Switch to napi [v3](https://napi.rs/blog/announce-v3).
With the exception of `Statement.iterate()`,  the behavior is preserved.
I had to temporarily remove it because the trait `Generator` doesn't
supports the new lifetime scoped values, I already brought this issue in
napi's discord server and it should be fixed soon.

Closes #2262
2025-07-25 20:19:37 +03:00
Diego Reis
0f95cf7751 bind/js: Switch to napi v3 2025-07-25 11:45:57 -03:00
Pekka Enberg
76cf3444c6 Turso 0.1.3-pre.5 2025-07-25 13:24:33 +03:00
Pekka Enberg
5018f0b7cb Turso 0.1.3-pre.4 2025-07-24 19:12:28 +03:00
Jussi Saurio
022f679fab chore: make every CREATE TABLE stmt in entire repo have 1 space after tbl name
`BTreeTable::to_sql` makes us incompatible with SQLite by losing e.g. the original whitespace provided during the CREATE TABLE command.

For now let's fix our tests by regex-replacing every CREATE TABLE in
the entire repo to have exactly 1 space after the table name in the
CREATE TABLE statement.
2025-07-22 11:35:21 +03:00
Pekka Enberg
f10723779d bindings/javascript: Add Drizzle example 2025-07-22 10:35:30 +03:00
Pekka Enberg
993079e39d bindings/python: Add "experimental_indexes" parameter to connect() 2025-07-21 12:49:38 +03:00
Pekka Enberg
440ff43a72 Merge 'gh workflow for dart (test, precompile, publish), only test is activated' from Andika Tanuwijaya
Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>

Closes #1957
2025-07-20 09:50:10 +03:00
Pekka Enberg
55b5e45231 Merge 'bindings/rust: Return number of rows changed from Connection::execute()' from Rohith Suresh
Fixes #1904
This PR changes the existing behaviour of Connection.execute to not
return 0, but the number of rows that have been changed by the operation
within. The changes are:
1. Adds a getter for n_change and the execute function now returns the
n_change value
2. Integration test  to test the behaviour

Closes #1987
2025-07-20 09:49:51 +03:00
Pekka Enberg
744f636c33 Merge 'bindings/java: Make TursoDB and TursoDB factory thread-safe' from Mikaël Francoeur
This PR makes `TursoDB` and `TursoDBFactory` thread-safe. I also used
the opportunity to do some minor improvements.

Reviewed-by: Kim Seon Woo (@seonWKim)

Closes #2070
2025-07-20 09:48:53 +03:00
RS2007
adf70dc855 Return number of rows changed from Connection.execute 2025-07-20 07:27:38 +05:30
Pekka Enberg
16958f1a44 Turso 0.1.3-pre.3 2025-07-19 08:44:22 +03:00
Diego Reis
b3c8255032 Fix clippy warnings 2025-07-18 11:26:10 -03:00