Commit Graph

363 Commits

Author SHA1 Message Date
Nikita Sivukhin
5838efe7dd rename flag to wal_auto_checkpoint_disabled 2025-08-13 15:26:25 +04:00
Nikita Sivukhin
c3c7463193 add debug logs to the memory io 2025-08-13 15:23:18 +04:00
Pekka Enberg
a6247e891f Turso 0.1.4-pre.8 2025-08-12 19:51:42 +03:00
Pekka Enberg
5a65617602 Turso 0.1.4-pre.7 2025-08-12 17:01:47 +03:00
Jussi Saurio
a7c1c8b7d4 Merge 'Use rusqlite 0.37 with bundled SQLite everywhere' from Jussi Saurio
Use the same rusqlite version in every crate and use a bundled up-to-
date sqlite version
(the impetus for this PR is still me trying to figure out why sqlite in
the insert benchmark doesn't seem to be fsyncing, even when instructed)

Closes #2507
2025-08-11 21:07:24 +03:00
Nikita Sivukhin
eb40d4aff6 remove turso-sync as now we have turso-sync-engine 2025-08-11 16:53:39 +04:00
Jussi Saurio
87bf488bbc chore: use rusqlite 0.37 with bundled sqlite everywhere 2025-08-11 15:13:57 +03:00
Piotr Rzysko
40a8058083 Use mimalloc in benchmark.rs 2025-08-11 08:02:35 +02:00
Pekka Enberg
81da795a66 Turso 0.1.4-pre.6 2025-08-08 16:50:24 +03:00
Pekka Enberg
7e8a84a681 Merge 'turso-sync: js package' from Nikita Sivukhin
This PR introduces `turso-sync-js` package with the following API (see
`./packages/turso-sync-js/example/cloud/example.js`):
```js
const { connect } = require('./sync_engine.js');
const db = await connect({ path: ..., url: ..., authToken: ...});

await (await db.prepare('SELECT * FROM users')).all();
await db.exec("INSERT INTO users VALUES (12345, 'turso-sync')");
await db.sync();
```

Closes #2480
2025-08-08 16:48:18 +03:00
Preston Thorpe
d3e6172516 Merge 'global allocator should not be set for library, only for executables' from Pedro Muniz
We should be allocator-agnostic. It is pretty limiting for us to force a
user to use a particular allocator. This is specially restricting for
`no_std` in the future.

Reviewed-by: bit-aloo (@Shourya742)
Reviewed-by: Preston Thorpe <preston@turso.tech>

Closes #2481
2025-08-08 09:45:35 -04:00
Nikita Sivukhin
3f0162307f configure cargo for napi-rs 2025-08-08 15:45:05 +04:00
Nikita Sivukhin
e6a3ee59d2 turso-sync-js package 2025-08-08 15:44:41 +04:00
Pekka Enberg
ba88d17f29 Turso 0.1.4-pre.5 2025-08-08 13:49:06 +03:00
Pekka Enberg
ad70157e74 Turso 0.1.4-pre.4 2025-08-08 11:54:26 +03:00
Pekka Enberg
8d5fb41f5d Turso 0.1.4-pre.3 2025-08-08 10:42:41 +03:00
pedrocarlo
edae65fb5f global allocator should not be set for library, only for executables 2025-08-07 13:41:50 -03:00
Nikita Sivukhin
09daa97150 format fixes 2025-08-06 21:53:03 +04:00
Nikita Sivukhin
b612259a3a more friendly copmletely runtime agnostic turso-sync-engine crate 2025-08-06 19:26:55 +04:00
Pekka Enberg
2913dc4dd4 Turso 0.1.4-pre.2 2025-08-06 10:52:32 +03:00
pedrocarlo
7bf35bcaf4 remove rexpect crate 2025-08-04 15:59:15 -03:00
Pekka Enberg
4aea9372bd Rename liblimbo_sqlite3 to libturso_sqlite3 2025-08-02 11:24:40 +03:00
Pekka Enberg
a67b0a8a1d Merge 'chore: move tx isolation fuzz test to 'tests'' from Jussi Saurio
Closes #2383
2025-08-01 13:50:04 +03:00
Pekka Enberg
994a0e0852 Turso 0.1.4-pre.1 2025-08-01 13:38:12 +03:00
Jussi Saurio
addb067416 chore: move tx isolation fuzz test to 'tests' 2025-08-01 13:02:05 +03:00
Levy A.
e35fdb8263 feat: zero-copy DatabaseHeader 2025-07-30 17:33:59 -03:00
Jussi Saurio
7caef278a5 Merge 'Rewrite the WAL' from Preston Thorpe
closes #1893
Adds some fairly extensive tests but I'll continue to add some python
tests on top of the unit tests.
## Restart:
tested 
- open new DB
- create table and do a bunch of inserts
- `pragma wal_checkpoint(RESTART);`
- close db file
- re-open and verify we can read the wal/repopulate the frame cache
- verify min|max frame
tested 
- open same DB
- add more inserts
- `pragma wal_checkpoint(RESTART);`
- do _more_ inserts
- close
- re-open
- verify checksums/max_frame are valid
- verify row count
## Truncate
tested 
- open new db
- create table and add inserts
- `pragma wal_checkpoint(truncate);`
- close file
- verify WAL file is empty (32 bytes, header only)
- re-open file
- verify content/row count
tested 
- open db
- create table and insert many rows
- `pragma wal_checkpoint(truncate);`
- insert _more_ rows
- close db file
- verify WAL file is valid
- re-open file
- verify we can read entire file/repopulate the frame cache
<img width="541" height="315" alt="image" src="https://github.com/user-
attachments/assets/0470c795-5116-4866-b913-78c07b06b68c" />
```
# header
magic=0x377f0682
version=3007000
page_size=4096
seq=2
salt=ec475ff2-7ea94342
checksum=c9464aff-c571cc22
```

Closes #2179
2025-07-30 18:50:49 +03:00
Jussi Saurio
d5b0d284e6 bindings/rust: add tx isolation fuzz test 2025-07-30 14:58:03 +03:00
Nikita Sivukhin
b78ce17022 properly configure TLS and use default features for rustls/hyper-rustls deps 2025-07-30 11:47:36 +04:00
Nikita Sivukhin
7cf296c7ab update deps 2025-07-30 00:58:36 +04:00
Nikita Sivukhin
298e0b459e fix after rebase 2025-07-29 14:42:51 +04:00
Nikita Sivukhin
bb96ce50fb fix after rebase 2025-07-29 14:42:10 +04:00
Nikita Sivukhin
4b893d1631 small fixes 2025-07-29 14:42:09 +04:00
Nikita Sivukhin
ea2f9faa13 fix build 2025-07-29 14:41:10 +04:00
Pekka Enberg
94dc780669 Turso 0.1.3 2025-07-29 12:37:18 +03:00
Pekka Enberg
a4737f82bc Turso 0.1.3-pre.10 2025-07-29 12:16:02 +03:00
Pekka Enberg
4f4d321822 Turso 0.1.3-pre.9 2025-07-29 10:58:09 +03:00
Pekka Enberg
a254f0ecaa Turso 0.1.3-pre.8 2025-07-29 10:13:30 +03:00
Pekka Enberg
04e7d45ac3 Turso 0.1.3-pre.7 2025-07-29 09:15:03 +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
Levy A.
cbb618f0ad feat(javascript): add tracing_subscriber 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
Pekka Enberg
16958f1a44 Turso 0.1.3-pre.3 2025-07-19 08:44:22 +03:00
Glauber Costa
32532b4feb Add a native MCP server
The SQLite command line has facilities to ingest things like csv, and
other formats. But here we are, in 2025, and I asked Claude if Turso's
CLI should, in the same vein, have a native MCP server.

Claude told me: "You're absolutely right!" "That's a great insight!"
"That's a fantastic idea!" and then proceeded to help me with the
boilerplate for this beautiful server.

Rust has a crate, mcp_server, that implements an mcp_server trait.
However, that depends on Tokio, and I think that would bloat our binary
too much.

I have also considered implementing an MCP server that operates on a
directory and allows to list many SQLite files, but figured that would
be a good job for a more advanced and specialized server, not for the
one that comes by default with the CLI. Let's go for simple.
2025-07-17 15:05:29 -05:00
Pekka Enberg
b03b06107b Turso 0.1.3-pre.2 2025-07-16 20:08:46 +03:00
Pekka Enberg
93634d56ba Turso 0.1.3-pre.1 2025-07-16 13:16:57 +03:00