Commit Graph

281 Commits

Author SHA1 Message Date
Pekka Enberg
77e5190113 Turso 0.1.5-pre.4 2025-09-09 19:57:31 +03:00
Nikita Sivukhin
853afbf4f9 update lock files 2025-09-09 14:33:55 +04:00
Nikita Sivukhin
f827731727 rename database-core -> database-common 2025-09-09 14:26:21 +04:00
Nikita Sivukhin
53e535f535 fix perf 2025-09-09 14:20:35 +04:00
Nikita Sivukhin
7618dfb519 final adjustments 2025-09-09 14:06:10 +04:00
Nikita Sivukhin
dfea7f0458 fix clippy again 2025-09-09 12:25:40 +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
Pekka Enberg
1511ad354b Turso 0.1.5-pre.3 2025-09-04 11:40:51 +03:00
Pekka Enberg
adca9e4c70 Merge 'introduce package.json for separate *-browser package (both database and sync)' from Nikita Sivukhin
This PR introduces separate `package.browser.json` file for `*-browser`
npm packages (`@tursodatabase/sync-browser` and
`@tursodatabase/database-browser`).
The packages are nearly identical and the only change is `package.json`
content (browser package mentions only WASM optional dependency which
shouldn't confuse NPM and force it to download WASM dep package instead
of native one).
Due to that, innocent "hack" is implemented which swap `package.json`
with `package.browser.json` before publish of `browser` package.

Closes #2906
2025-09-04 11:40:34 +03:00
Nikita Sivukhin
9f282cf1e0 update readme 2025-09-03 18:21:22 +04:00
Nikita Sivukhin
62e7384771 build native package for ARM64 2025-09-03 17:57:15 +04:00
Nikita Sivukhin
185392fb9d skip optional packages publish as they will be published for native package 2025-09-03 17:26:36 +04:00
Nikita Sivukhin
40dd9be201 introduce package.json for separate *-browser package (both database and sync) 2025-09-03 17:15:47 +04:00
Pekka Enberg
6c7936a016 Turso 0.1.5-pre.2 2025-09-02 12:45:41 +03:00
Pekka Enberg
d959319b42 Merge 'Use u64 for file offsets in I/O and calculate such offsets in u64' from Preston Thorpe
Using `usize` to compute file offsets caps us at ~16GB on 32-bit
systems. For example, with 4 KiB pages we can only address up to 1048576
pages; attempting the next page overflows a 32-bit usize and can wrap
the write offset, corrupting data. Switching our I/O APIs and offset
math to u64 avoids this overflow on 32-bit targets

Closes #2791
2025-09-02 09:06:49 +03:00
Pekka Enberg
3c9dbfb09e Turso 0.1.5-pre.1 2025-08-30 18:28:38 +03:00
PThorpe92
0a56d23402 Use u64 for file offsets in IO and calculate such offsets in u64 2025-08-28 09:44:00 -04:00
Avinash Sajjanshetty
9e663c7f46 Add IOContext to carry encryption/checksum ctx 2025-08-27 21:33:05 +05:30
Pekka Enberg
22c9cb6618 s/PerConnEncryptionContext/EncryptionContext/ 2025-08-24 08:17:20 +03:00
Pekka Enberg
1b89273f10 Merge 'refactor encryption module and make it configurable' from Avinash Sajjanshetty
Previously, the encryption module had hardcoded a lot of things. This
refactor makes it slightly nice and makes it configurable.
Right now cipher algorithm is assumed and hardcoded, I will make that
configurable in the upcoming PR

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

Closes #2722
2025-08-24 08:16:28 +03:00
Pekka Enberg
2c68613709 bindings/javascript: Fix blob type handling 2025-08-22 14:17:40 +03:00
Avinash Sajjanshetty
3090545167 use encryption ctx instead of encryption key 2025-08-21 22:36:32 +05:30
Pekka Enberg
c2208a542a Merge 'Initial pass to support per page encryption' from Avinash Sajjanshetty
This patch adds support for per page encryption. The code is of alpha
quality, was to test my hypothesis. All the encryption code is gated
behind a `encryption` flag. To play with it, you can do:
```sh
cargo run --features encryption -- database.db

turso> PRAGMA key='turso_test_encryption_key_123456';

turso> CREATE TABLE t(v);
```
Right now, most stuff is hard coded. We use AES GCM 256. This
information is not stored anywhere, but in future versions we will start
saving this info in the file. When writing to disk, we will generate a
cryptographically secure random salt, use that to encrypt the page. Then
we will store the authentication tag and the salt in the page itself. To
accommodate this encryption hardcodes reserved space of 28 bytes.
Once the key is set in the connection, we propagate that information to
pager and the WAL, to encrypt / decrypt when reading from disk.

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

Closes #2567
2025-08-20 11:11:24 +03:00
Pekka Enberg
494ce41d80 Turso 0.1.4 2025-08-20 10:35:35 +03:00
Avinash Sajjanshetty
40a209c000 simplify feature flag usage for encryption 2025-08-20 12:49:38 +05:30
Pekka Enberg
d456db31db Turso 0.1.4-pre.11 2025-08-20 09:32:10 +03:00
Avinash Sajjanshetty
fc3b76de1b fix Database storage for WASM bindings 2025-08-20 11:47:25 +05:30
Pekka Enberg
8d7ab52471 Turso 0.1.4-pre.10 2025-08-19 19:32:47 +03:00
Pekka Enberg
54b4fdaa7d javascript: Implement transactions API 2025-08-19 16:35:44 +03:00
Pekka Enberg
387d384394 javascript: Implement Statement.columns() 2025-08-19 16:35:44 +03:00
Pekka Enberg
5002539b04 javascript: Implement safe integers 2025-08-19 16:35:44 +03:00
Pekka Enberg
6b59bcd51e javascript: Fix Statement.get() for boundary values 2025-08-19 16:35:44 +03:00
Pekka Enberg
692323ae9b bindings/javascript: Rename @tursodatabase/database/sync to compat
We already have a `@tursodatabase/sync` package so let's make the name of the
better-sqlite3 compatibility API package stand out.
2025-08-19 13:20:34 +03:00
Pekka Enberg
976403b080 bindings/javascript: Add TypeScript declarations to package
Fixes #2621
2025-08-19 12:34:49 +03:00
Pekka Enberg
3a72b478d2 Turso 0.1.4-pre.9 2025-08-18 12:55:45 +03:00
PThorpe92
cc2fed3297 Remove copy_to API from file IO trait 2025-08-14 21:31:13 -04:00
PThorpe92
3c088dda59 Update callsites of copy_to Database impl 2025-08-14 21:31:13 -04:00
Jussi Saurio
c75e4c1092 Fix non-4096 page sizes by making WAL header lazy 2025-08-14 12:40:58 +03:00
Jussi Saurio
ee58b7bd86 Add fn read_header() to DatabaseStorage trait 2025-08-14 12:40:58 +03:00
Nikita Sivukhin
bfa33a27e2 enable indices in database JS sdk 2025-08-13 15:55:40 +04:00
Pekka Enberg
a6247e891f Turso 0.1.4-pre.8 2025-08-12 19:51:42 +03:00
Pekka Enberg
475799b3e9 Unify JavaScript package README files 2025-08-12 19:30:02 +03:00
Pekka Enberg
269b23ece5 Merge branch 'main' of https://github.com/tursodatabase/limbo 2025-08-12 17:08:30 +03:00
Pekka Enberg
5a65617602 Turso 0.1.4-pre.7 2025-08-12 17:01:47 +03:00
Pekka Enberg
96673a54a8 bindings/javascript: Add async connect() function
Let's make the API symmetric with libSQL and serverless drivers.
2025-08-12 11:39:59 +03:00
Pekka Enberg
81da795a66 Turso 0.1.4-pre.6 2025-08-08 16:50:24 +03:00
Pekka Enberg
ba88d17f29 Turso 0.1.4-pre.5 2025-08-08 13:49:06 +03:00
Pekka Enberg
f2b2e4d4d8 Rename JavaScript package to @tursodatabase/database 2025-08-08 13:22:10 +03:00