Commit Graph

390 Commits

Author SHA1 Message Date
Pekka Enberg
b984ddf98f Turso 0.3.0-pre.4 2025-10-22 13:42:52 +03:00
Nikita Sivukhin
948bd557cd use simsimd for dense operations 2025-10-21 14:59:01 +04:00
Pekka Enberg
3020966fbd Turso 0.3.0-pre.3 2025-10-17 11:08:36 +03:00
Pekka Enberg
e9c0fdcb4b Turso 0.3.0-pre.2 2025-10-16 11:31:30 +03:00
Pekka Enberg
fb1042187b Turso 0.3.0-pre.1 2025-10-10 19:25:58 +03:00
Nikita Sivukhin
bd1013d62f emit proper column information for explain prepared statements 2025-10-07 12:28:55 +04:00
Nikita Sivukhin
d2dab3d18c fix main workspace dir 2025-10-06 18:30:29 +04:00
Nikita Sivukhin
926fd25cdd move examples to the top-level directory 2025-10-06 18:01:54 +04:00
pedrocarlo
e93add6c80 remove dyn DatabaseStorage and replace it with DatabaseFile 2025-10-03 14:14:15 -03:00
Nikita Sivukhin
f582744819 fix package jsons 2025-10-03 14:44:15 +04:00
Nikita Sivukhin
82d53f8d06 add sync-wasm-vite example 2025-10-03 14:43:23 +04:00
Nikita Sivukhin
d4373379cd remove wasm example 2025-10-03 14:20:18 +04:00
Nikita Sivukhin
17c99de34f accept libsql:// urls generated by the platform 2025-10-03 14:19:36 +04:00
Nikita Sivukhin
515ccfea76 small adjustment 2025-10-03 14:19:07 +04:00
Nikita Sivukhin
73049a0205 add sync node example 2025-10-03 14:18:52 +04:00
Nikita Sivukhin
b67ef8a7eb add basic examples for database-wasm package 2025-10-03 13:23:59 +04:00
Pekka Enberg
7905841990 Turso 0.2.0 2025-10-03 12:20:42 +03:00
Pekka Enberg
3b1d2535de Turso 0.2.0-pre.15 2025-10-03 11:29:43 +03:00
Nikita Sivukhin
9a82a9509f fix sync-engine bug when auth token is provided as dynamic function 2025-10-03 10:50:54 +04:00
Pekka Enberg
78e3311c3b Merge 'Sync engine defered sync' from Nikita Sivukhin
This PR makes sync client completely autonomous as now it can defer
initial sync.
This can open possibility to asynchronously create DB in the Turso Cloud
while giving user ability to interact with local DB straight away.

Closes #3531
2025-10-02 17:25:11 +03:00
Nikita Sivukhin
649fddedf6 remove unnecessary clone 2025-10-02 17:31:30 +04:00
Nikita Sivukhin
cff23c80cb fix wasm client 2025-10-02 16:56:54 +04:00
Nikita Sivukhin
39bf35abe9 adjust native sync client 2025-10-02 16:51:08 +04:00
Nikita Sivukhin
863e3fe94e make url parameter to accept either string or function 2025-10-02 16:17:36 +04:00
Nikita Sivukhin
64389447e3 support defered sync in the bindings core 2025-10-02 16:17:36 +04:00
Pekka Enberg
a44f965a45 Turso 0.2.0-pre.14 2025-10-02 14:29:22 +03:00
Pekka Enberg
4666544ea6 Turso 0.2.0-pre.13 2025-10-01 16:40:53 +03:00
Pekka Enberg
4d77786b53 Merge 'Beta' from Pekka Enberg
Reviewed-by: Glauber Costa <glommer@gmail.com>

Closes #3484
2025-10-01 15:23:28 +03:00
Jussi Saurio
8166680ad8 Merge 'make connect() method optional and call it implicitly on first query execution' from Nikita Sivukhin
- mostly needed for Drizzle - because other clients with ESM can just
use await connect(...) wrapper

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

Closes #3462
2025-10-01 15:19:07 +03:00
Nikita Sivukhin
109b3c0609 fix sync package 2025-10-01 11:08:42 +04:00
Pekka Enberg
16540724aa Beta 2025-10-01 07:18:25 +03:00
Nikita Sivukhin
7869ac348e rewrite MaybeLazy and add some test 2025-10-01 02:24:29 +04:00
Nikita Sivukhin
33c46f77ce add js test 2025-09-30 22:46:21 +04:00
Nikita Sivukhin
18e8c037e9 fix tests 2025-09-30 20:45:00 +04:00
Nikita Sivukhin
4772c0406e make connect() method optional and call it implicitly on first query execution
- mostly needed for Drizzle - because other clients with ESM can just use await connect(...) wrapper
2025-09-30 18:40:01 +04:00
Avinash Sajjanshetty
a360efa6e0 enable encryption feature flag by default 2025-09-30 19:04:25 +05:30
Pekka Enberg
b0d27c90aa Turso 0.2.0-pre.11 2025-09-29 18:11:59 +03:00
Pekka Enberg
f4bf635129 Merge 'javascript: Rename "browser" packages to "wasm"' from Pekka Enberg
Closes #3417
2025-09-29 18:11:30 +03:00
Pekka Enberg
57c279e2b0 javascript: Rename "browser" packages to "wasm" 2025-09-29 17:02:34 +03:00
Nikita Sivukhin
70e18ce3f7 validate zero limit at the beginning in the VDBE program
- before, we validated that condition during program emit - which works for fixed values of parameters but doesn't work with variables provided externally to the prepared statement
2025-09-29 15:32:36 +04:00
Pekka Enberg
2f38d2ef04 Turso 0.2.0-pre.10 2025-09-27 16:52:35 +03:00
Pekka Enberg
92291ed736 Merge 'Fix offset variable handling' from Nikita Sivukhin
Before, db generated incorrect plan in case when offset parameter were
introduced as variable:
```
turso> EXPLAIN SELECT * FROM users LIMIT ? OFFSET ?;
addr  opcode             p1    p2    p3    p4             p5  comment
----  -----------------  ----  ----  ----  -------------  --  -------
0     Init               0     16    0                    0   Start at 16
1     Variable           1     1     0                    0   r[1]=parameter(1); OFFSET expr
2     MustBeInt          1     0     0                    0
3     Variable           2     2     0                    0   r[2]=parameter(2); OFFSET expr
4     MustBeInt          2     0     0                    0
5     OffsetLimit        1     3     2                    0   if r[1]>0 then r[3]=r[1]+max(0,r[2]) else r[3]=(-1)
6     OpenRead           0     2     0                    0   table=users, root=2, iDb=0
7     Rewind             0     15    0                    0   Rewind table users
8       Variable         2     2     0                    0   r[2]=parameter(2); OFFSET expr
9       MustBeInt        2     0     0                    0
10      IfPos            2     14    1                    0   r[2]>0 -> r[2]-=1, goto 14
11      Column           0     0     4                    0   r[4]=users.x
12      ResultRow        4     1     0                    0   output=r[4]
13      DecrJumpZero     1     15    0                    0   if (--r[1]==0) goto 15
14    Next               0     8     0                    0
15    Halt               0     0     0                    0
16    Transaction        0     1     1                    0   iDb=0 tx_mode=Read
17    Goto               0     1     0                    0
```

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

Closes #3360
2025-09-27 08:20:54 +03:00
Preston Thorpe
ddbedecace Merge 'fix encryption config in the sync-client' from Nikita Sivukhin
Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>

Closes #3379
2025-09-26 19:01:27 -04:00
Pekka Enberg
222ab125c1 Turso 0.2.0-pre.9 2025-09-26 19:00:14 +03:00
Nikita Sivukhin
fe4bfb7c88 fix encryption config in the sync-client 2025-09-26 19:29:37 +04:00
Nikita Sivukhin
5bf69350b3 add simple tests for offset/limit binding 2025-09-26 18:06:20 +04:00
Nikita Sivukhin
a0c47b98b8 fix test 2025-09-26 17:42:11 +04:00
Nikita Sivukhin
52f3216211 fix avg aggregation
- ignore NULL rows as SQLite do
- emit NULL instead of NaN when no rows were aggregated
- adjust agg column alias name
2025-09-26 17:11:06 +04:00
Pekka Enberg
f8130d051f Merge 'Fix JavaScript bindings' from Nikita Sivukhin
This PR makes all JS db packages to have uniform interface: `new
Database(...)` constructor with explicit `connect()` and `close()`
methods.
Also, this PR adds docstrings in the code and properly support few
better-sqlite options (readonly, fileMustExist, timeout)

Closes #3334
2025-09-25 17:24:03 +03:00
Nikita Sivukhin
27a7f7faa7 fix clippy 2025-09-25 12:12:39 +04:00