8 Commits

Author SHA1 Message Date
Nikita Sivukhin
149635b0c8 use transactionAsync instead of transaction 2026-07-17 16:09:13 +02:00
Nikita Sivukhin
6931576650 wip 2026-07-17 15:28:14 +02:00
Pekka Enberg
f6a16e8299 Add Database.batch() to the JavaScript SDKs
The batch() method executes an array of SQL statements over a single
connection and returns aggregated `rowsAffected` and `lastInsertRowid`. Each
statement is either a SQL string or a `{ sql, args }` object with positional
or named bind parameters; named-args objects are forwarded to the underlying
engine as named parameters rather than collapsed via Object.values().

By default the batch is non-transactional: each statement runs in its own
autocommit step. Passing a `mode` -- `deferred`, `immediate`, `exclusive`, or
`concurrent` -- makes the batch atomic. You can also use `batch()` with the
transaction API to make it transactional.

The serverless driver implements atomic batch as a a single SQL over HTTP
request. The wire payload chains BEGIN, the user statements, COMMIT, and
ROLLBACK as a single batch using the server-side condition operators.
2026-05-19 16:25:07 +03:00
Pekka Enberg
457cd28414 Add per-connection and per-statement query timeout
Introduce a configurable query timeout that interrupts long-running
statements after a deadline. Supports a connection-level default
(set_query_timeout) and per-statement overrides via the JS bindings.
The VM checks the monotonic clock in its execution loops and transitions
to Interrupting state when the deadline is exceeded.
2026-03-30 14:19:18 +03:00
Pekka Enberg
4e144df120 Move @tursodatabase/serverless to serverless/javascript
Reorganize serverless SDKs under a top-level serverless/ directory
to support multi-language serverless drivers alongside the existing
bindings/ convention.
2026-03-26 08:15:10 +02:00
Pekka Enberg
da80e6f760 Add links to JavaScript packages 2025-08-19 19:31:32 +03:00
Pekka Enberg
33ddae1877 Fix JavaScript API reference 2025-08-18 14:00:46 +03:00
Pekka Enberg
eae6e056cb Add JavaScript API reference document 2025-08-01 15:56:08 +03:00