Commit Graph

7340 Commits

Author SHA1 Message Date
PThorpe92
39d230a899 Add bitmap for tracking pages in arena 2025-08-08 10:55:27 -04:00
PThorpe92
0ffba81216 Make register buffer io trait return the buf index 2025-08-08 10:55:27 -04:00
PThorpe92
3cff47e490 Fix btree test to properly initialize pool 2025-08-08 10:55:27 -04:00
PThorpe92
fd09fe1237 Adjust io_uring to register two arenas, one for frames and the other for db pages 2025-08-08 10:55:27 -04:00
PThorpe92
cc75bc448e Move TLC buffer cache to io/mod 2025-08-08 10:55:27 -04:00
PThorpe92
9d1ca1c8ca Add ReadFixed/WriteFixed opcodes for buffers from registered arena 2025-08-08 10:55:27 -04:00
PThorpe92
dffa47b048 Use temp buffer for wal header 2025-08-08 10:55:27 -04:00
PThorpe92
2e072cadb0 Add CI=true env var so the tests dont each allocate 4mb by default 2025-08-08 10:55:26 -04:00
PThorpe92
7ea52a3f89 Fix changing page size and initialization for buffer pool 2025-08-08 10:55:26 -04:00
PThorpe92
036ae596c4 Fix test with old buffer api 2025-08-08 10:55:26 -04:00
PThorpe92
0884fec799 Use parent buffer pool for ephemeral pager and wal 2025-08-08 10:55:26 -04:00
PThorpe92
5750b1229c Setup and initialize pool properly 2025-08-08 10:55:26 -04:00
PThorpe92
4ffb273b53 Adjust IO to use new buffer pool and buffer API 2025-08-08 10:55:26 -04:00
PThorpe92
27113885a9 Update sorter to use new buffer api 2025-08-08 10:55:26 -04:00
PThorpe92
a02f527c06 Add fast path for pwritev on other IO backends 2025-08-08 10:55:25 -04:00
PThorpe92
39bccc2357 Update Buffer type in io module to adjust to new pool 2025-08-08 10:55:25 -04:00
PThorpe92
d38cd6360a Create new arena backed buffer pool 2025-08-08 10:55:25 -04:00
Pekka Enberg
81da795a66 Turso 0.1.4-pre.6 2025-08-08 16:50:24 +03:00
Pekka Enberg
6ccee4267b Add sync package to scripts/update-version.py 2025-08-08 16:50:02 +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
Jussi Saurio
2fbe33d200 Merge 'translate: return parse errors for unsupported features instead of silently ignoring' from Jussi Saurio
Closes #1510

Closes #2505
2025-08-08 15:56:13 +03:00
Jussi Saurio
cca2f6c947 Merge 'Evaluate WHERE conditions after LEFT JOIN' from Piotr Rżysko
This fix ensures that `WHERE` conditions are emitted after the `LEFT
JOIN` match flag is set, so rows from the right table are properly
filtered, even when they are `NULL` due to the outer join.
Previously, the query below would return rows where `products.price` was
`NULL`:
```sql
SELECT users.id, price
FROM users
LEFT JOIN products ON users.id = products.id
WHERE products.price IS NOT NULL;
```

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

Closes #2501
2025-08-08 15:54:17 +03:00
Jussi Saurio
b19a86673e Merge 'Btree cache usable space' from Jussi Saurio
Built on top of #2502
```rust
    /// Cached value of the usable space of a BTree page, since it is very expensive to call in a hot loop via pager.usable_space().
    /// This is OK to cache because both 'PRAGMA page_size' and '.filectrl reserve_bytes' only have an effect on:
    /// 1. an uninitialized database,
    /// 2. an initialized database when the command is immediately followed by VACUUM.
    usable_space_cached: usize,
```

Reviewed-by: Nikita Sivukhin (@sivukhin)

Closes #2503
2025-08-08 15:53:38 +03:00
Nikita Sivukhin
d2a8162e10 sync bootstrapped files in the end 2025-08-08 16:40:29 +04:00
Nikita Sivukhin
2ccdafd2a5 update sync engine wrapper 2025-08-08 16:40:19 +04:00
Nikita Sivukhin
d8847b90c6 small fixes in workflow files 2025-08-08 15:48:57 +04:00
Nikita Sivukhin
3f0162307f configure cargo for napi-rs 2025-08-08 15:45:05 +04:00
Nikita Sivukhin
d25acf3c2c small adjustments in the sync engine js 2025-08-08 15:44:42 +04:00
Nikita Sivukhin
ca20af6f89 fix package.json 2025-08-08 15:44:42 +04:00
Nikita Sivukhin
a289c459bc fix CI one more time 2025-08-08 15:44:42 +04:00
Nikita Sivukhin
22858de0f0 more CI fixes 2025-08-08 15:44:42 +04:00
Nikita Sivukhin
4595d5b7a3 fix Cargo.toml 2025-08-08 15:44:42 +04:00
Nikita Sivukhin
5788e654b7 fix APP_NAME 2025-08-08 15:44:42 +04:00
Nikita Sivukhin
50588c5edf cargo fmt 2025-08-08 15:44:42 +04:00
Nikita Sivukhin
54879a36ba add publish workflow 2025-08-08 15:44:42 +04:00
Nikita Sivukhin
572a910c52 add simple example 2025-08-08 15:44:42 +04:00
Nikita Sivukhin
3c181939ad adjust js package 2025-08-08 15:44:42 +04:00
Nikita Sivukhin
e6a3ee59d2 turso-sync-js package 2025-08-08 15:44:41 +04:00
Nikita Sivukhin
405e7f56a6 small adjustments in the sync-engine 2025-08-08 15:40:57 +04:00
Pekka Enberg
ba88d17f29 Turso 0.1.4-pre.5 2025-08-08 13:49:06 +03:00
Pekka Enberg
2f77b5867a Merge 'Rename JavaScript package to ' from Pekka Enberg
Reviewed-by: Nikita Sivukhin (@sivukhin)

Closes #2508
2025-08-08 13:47:51 +03:00
Pekka Enberg
f2b2e4d4d8 Rename JavaScript package to @tursodatabase/database 2025-08-08 13:22:10 +03:00
Pekka Enberg
ad70157e74 Turso 0.1.4-pre.4 2025-08-08 11:54:26 +03:00
Pekka Enberg
5b578dd790 bindings/javascript: Fix "npm publish" to build the package 2025-08-08 11:53:58 +03:00
Jussi Saurio
21dc2d0161 translate: return parse errors for unsupported features instead of silently ignoring 2025-08-08 11:39:30 +03:00
Pekka Enberg
8d5fb41f5d Turso 0.1.4-pre.3 2025-08-08 10:42:41 +03:00
Pekka Enberg
f7eb6c2cee Turso v0.1.4-pre.3 2025-08-08 10:42:38 +03:00
Pekka Enberg
7a09eb0d4c Merge 'Fix JavaScript bindings packaging' from Nikita Sivukhin
This PR configure `#entry-point` import alias for javascript bindings in
order to use `browser.js` napi-rs generated file in browser context.
Also, this PR forces napi-rs to emit `index.js` entrypoint using ESM and
also use typescript for writing our wrapper code around napi-rs
bindings.
In order to make behaviour consistent when lib is imported through ESM
or CommonJS this PR also replace default export of `Database` by named
on. The problem is that `export default Database` will be logically
equivalent to `modules.export.default = Database` which is not the same
thing as `modules.export = Database` and this will need to access
additional `.default` field with CommonJs style imports (e.g. `new
require('@tursodatabase/turso').default(...)`). In order to remove this
difference - I just replaced default export with named one.

Closes #2488
2025-08-08 10:42:21 +03:00
Jussi Saurio
7fd63d8a5d btree: cache usable_space in the btreecursor constructor 2025-08-08 10:32:18 +03:00