32 Commits

Author SHA1 Message Date
Pekka Enberg
230f652b5b deps: update brace-expansion to fix quadratic parsing of trailing braces
Expanding input shaped like {a}}}}...,z} takes time quadratic in the
number of literal } characters. The parser rewrites the string and
restarts the scan once per brace, and each rewrite also grows the
working string by about 25 characters. A 128 KB pattern blocks the
event loop for close to half a minute. The max and maxLength caps do
not help because the cost is in parsing, before any results exist.

Every major line in use here is affected, so this moves each pinned
copy to the patched release on its own line: 1.1.21, 2.1.7 and 5.0.12.
npm also re-synced stale metadata for the locally linked
@tursodatabase packages while rewriting the lockfiles.

Tests: ran the advisory's reproduction against serverless/javascript
before and after npm ci. On 2.1.4, n=32000 took 2358 ms. On 2.1.7 it
took 15 ms.
2026-10-14 09:49:10 +03:00
Pekka Enberg
910cab5251 serverless/js: fix query failure on column names that are array properties
Rows from the cursor endpoint are built as arrays with one extra
property per column name, so the compat ResultSet rows can be read by
index and by name. Defining a column-name property that the array
already owns throws, so a query returning such a column fails outright
("Cannot redefine property", or "Cannot convert a BigInt value to a
number" with safeIntegers()).

Never overwrite a property the row already has. This is the rule
@libsql/hrana-client and libsql-client use for their rows. As a side
effect, compat rows with duplicate column names now keep the first value
by name instead of the last, matching libsql-client.

Tests: new "Statement.all() [column names that are JavaScript object
properties]" conformance test in testing/conformance/javascript covering
length, map, toString and hasOwnProperty. Run with PROVIDER=serverless
against a local `turso dev` server it fails on the unfixed driver and
passes with the fix.
2026-10-06 10:02:35 +03:00
Preston Thorpe
6ac915124f Merge 'batch API: full per-statement results in every driver, fixing a complaint we've carried since libSQL' from Glauber Costa
Ever since the libSQL days, the batch API has had the same complaint:
you
could not get the result of each individual statement, and when a batch
failed you could not tell which statement failed — or what had already
taken effect. With Turso we have a blank slate, and it turns out the
protocol never was the limitation: a batch response carries complete
per-statement information (results, last insert rowid, error codes, and
the execution statistics `rows_read`, `rows_written`,
`query_duration_ms`; PROTOCOL.md §6.2, §8.4, §9.1). The drivers just
dropped it. This PR takes the opportunity to do it right.
Every driver now exposes one `batch()` API that returns everything the
protocol reports, per statement, in one HTTP round trip:
- **Per-statement results**: rows, affected row count, last insert
  rowid, and the server-side execution statistics.
- **Failure visibility**: statements execute in order and stop at the
  first failure; the error identifies the failing statement by index
  *and* carries one entry per statement — the completed statement's
  result, or null/None for the failing statement and the ones that never
  ran. In a non-atomic batch the completed statements are committed, and
  the caller can finally see exactly what took effect.
- **Atomic mode**: the transactional variant wraps the statements in
  `BEGIN <mode>` / `COMMIT` with a conditional `ROLLBACK`, carried by
the
  same single request.
Per driver:
- **JavaScript** (`serverless/javascript`, existing public API —
extended
  compatibly): each `ResultSet` gains `lastInsertRowid`, `rowsRead`,
  `rowsWritten`, `queryDurationMs`; the thrown `DatabaseError` gains
  `batchIndex` and `batchResults`. `batch()` moves from the cursor
  endpoint to a pipeline batch request because the cursor stream's
  `step_end` does not carry the statistics. Non-atomic batches are now
  gated on the previous statement succeeding — previously statements
  after a failure kept executing server-side.
- **Rust** (new API, `bindings/rust` + `serverless/rust` in one commit
  per the driver-parity rule): `Connection::batch` /
  `Connection::transactional_batch`,
`BatchStatement`/`IntoBatchStatement`
  inputs, `BatchResult` with stats accessors, and
  `Error::BatchStatementFailed { index, error, results }`. The sync
  driver shares the embedded `Connection`, so all three backends expose
  the same API.
- **Python** (new API, `bindings/python` + `serverless/python` in one
  commit): `Connection.batch(statements, mode=None)` on the DB-API
  surface (sync, aio, and the sync-database driver via inheritance),
  raising the classified DB-API exception with `batch_index` and
  `batch_results` attributes.
The parity requirement itself is codified first, in
`serverless/conformance/differential/README.md` ("Driver API parity")
with a pointer from the AGENTS.md core principles.
**Deliberately skipped: Go.** The Go serverless driver is a plain
`database/sql` driver, and `database/sql` has no batch surface, so it is
less obvious what to do there: libsql-client-go's precedent is splitting
multi-statement SQL client-side (with a vendored ANTLR SQLite parser)
inside `Exec`, while the alternative is a driver-specific `Batch` API
outside the standard interface. That trade-off deserves its own
discussion and PR.
The batch behavior is property-tested: a `param_batch` operation in the
shared differential vocabulary (`spec/ops.json`) generates 1-4
parameterized statements — including planted failures and atomic modes —
and all three language harnesses (fast-check, hypothesis, hegel) assert
that the embedded and serverless drivers agree on every statement's
result, the failing index, and the partial results carried by the error.
Building those harnesses caught two real driver bugs before the tests
ever ran: the embedded JS driver had no batch error surface at all, and
the embedded Rust driver reported the connection's stale change counter
for row-returning statements inside a batch.
Follow-ups, out of scope here:
- Whether the JS `compat` (libsql-compat) layer should surface the new
  per-statement `ResultSet` fields on success; it is kept libsql-shaped
  here (the error path does preserve `batchIndex`/`batchResults`).
- Driver-wide preservation of `extended_code` on errors (today only the
  Python serverless `ServerError` keeps it).
- A batch entry containing multi-statement SQL ("a; b") errors on the
  embedded drivers but the server prepares only the first statement — an
  embedded/serverless divergence worth its own discussion.
Also rides along in the JS commit: four env-gated integration tests
still
asserted positional access on expanded rows, which f52724d45 removed on
purpose; CI never runs those tests, so they had drifted.
Tested against a live libsql-server and against Turso Cloud: Rust 44
unit + 58 conformance tests plus the hegel parity property, Python 73
serverless + 236 embedded plus the hypothesis parity property,
JavaScript 42 integration tests plus the fast-check parity property, and
protocol-level coverage asserting a parameterized multi-statement batch
in a single pipeline POST.
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Closes #8535
2026-08-29 08:36:30 -07:00
Amp
3e4fe811eb testing/js: update vulnerable conformance dependencies
Refresh tar, brace-expansion, and js-yaml to fixed versions in the JavaScript conformance lockfile.

Tests: npm ci --ignore-scripts; npm audit --package-lock-only
Co-authored-by: pedro muniz <pedro.muniz.carlo@gmail.com>
2026-08-29 17:33:11 +03:00
Glauber Costa
a368eab3af js: return full per-statement details from batch() in every driver
The protocol reports complete per-statement information for a batch —
results, last insert rowid, error codes, and the execution statistics
rows_read, rows_written, and query_duration_ms — but batch() dropped
most of it. Extend the batch API compatibly, in the serverless driver
and in the embedded driver (@tursodatabase/database, whose
DatabasePromise is shared by the wasm and sync drivers), per the driver
API parity requirement:

- Each ResultSet also carries lastInsertRowid, plus rowsRead,
  rowsWritten, and queryDurationMs on the serverless driver (the
  embedded engine does not report those per statement). The
  lastInsertRowid key is present only on entries whose statement
  inserted, so `"lastInsertRowid" in resultSet` detects an insert.
- The serverless batch() uses a pipeline batch request instead of the
  cursor endpoint, because the cursor stream does not carry the
  statistics, and gates each statement on its predecessor succeeding,
  so execution stops at the first failure instead of running the
  remaining statements against a failed batch — the embedded driver's
  sequential semantics.
- The thrown error carries batchIndex (the zero-based index of the
  failing statement) and batchResults (one entry per statement: the
  completed statement's ResultSet, or null for the failing and skipped
  ones; empty when a bind value fails to encode client-side before
  anything is sent), so callers can tell exactly which statements took
  effect.
- The libsql-compat batch() returns the full libSQL ResultSet shape —
  lastInsertRowid and toJSON() included, matching @libsql/client, whose
  batch() returns the same ResultSet as execute() — and both of its
  batch entry points preserve batchIndex and batchResults on the
  LibsqlError they throw.

The JavaScript conformance contract covers the per-statement detail
fields. Also update the serverless integration tests that still
asserted positional access on expanded rows, removed in f52724d45.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-28 10:40:25 -07:00
Nikita Sivukhin
c1a9bda71d run transactionAsync over separate session 2026-07-24 11:52:36 +02:00
dependabot[bot]
b225a3a1f9 build(deps-dev): bump brace-expansion in /testing/conformance/javascript
Bumps [brace-expansion](https://github.com/juliangruber/brace-expansion) from 2.1.0 to 2.1.2.
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](https://github.com/juliangruber/brace-expansion/compare/v2.1.0...v2.1.2)

---
updated-dependencies:
- dependency-name: brace-expansion
  dependency-version: 2.1.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-23 07:02:24 +00:00
Pekka Enberg
7b5fbf8aa1 Merge 'bindings/js, serverless/js: collapse duplicate column names in expanded rows' from Pekka Enberg
Expanded rows grew hidden non-enumerable positional properties ("0",
"1", ...) in 4c0febfed ("Preserve JS row positional values") to work
around duplicate column names collapsing in object rows. That is a
Turso-only extension: neither better-sqlite3 nor libsql attaches
positional keys to expanded rows, so the conformance suite failed under
PROVIDER=better-sqlite3 and PROVIDER=libsql, and a result column
literally named "0" would collide with the synthetic property.
Remove the positional properties from the native binding's expanded row
mode and the serverless driver's createExpandedRow so expanded rows are
plain objects where duplicate names collapse, exactly like
better-sqlite3 and libsql. Positional access remains available through
raw mode, and the libsql-client compat surface keeps its genuine hybrid
rows built by Session.createRowObject.
The divergence went unnoticed because CI only ran the conformance suite
under PROVIDER=turso; the workflow now also runs it against
better-sqlite3 so drop-in incompatibilities fail in CI.
Tests: rewrote the positional-value tests to assert the collapsing
behavior plus raw-mode access, so they pass identically under the
turso, better-sqlite3, and libsql providers.

Closes #7907
2026-07-21 07:43:32 +03:00
Nikita Sivukhin
1262625452 Merge branch 'main' into fix-async-txn-ts-simple 2026-07-20 22:16:28 +02:00
Pekka Enberg
f52724d450 bindings/js, serverless/js: collapse duplicate column names in expanded rows
Expanded rows grew hidden non-enumerable positional properties ("0",
"1", ...) in 4c0febfed ("Preserve JS row positional values") to work
around duplicate column names collapsing in object rows. That is a
Turso-only extension: neither better-sqlite3 nor libsql attaches
positional keys to expanded rows, so the conformance suite failed under
PROVIDER=better-sqlite3 and PROVIDER=libsql, and a result column
literally named "0" would collide with the synthetic property.

Remove the positional properties from the native binding's expanded row
mode and the serverless driver's createExpandedRow so expanded rows are
plain objects where duplicate names collapse, exactly like
better-sqlite3 and libsql. Positional access remains available through
raw mode, and the libsql-client compat surface keeps its genuine hybrid
rows built by Session.createRowObject.

The divergence went unnoticed because CI only ran the conformance suite
under PROVIDER=turso; the workflow now also runs it against
better-sqlite3 so drop-in incompatibilities fail in CI.

Tests: rewrote the positional-value tests to assert the collapsing
behavior plus raw-mode access, so they pass identically under the
turso, better-sqlite3, and libsql providers.
2026-07-20 20:11:59 +03:00
Pekka Enberg
3e246552e9 serverless: remove Connection.execute() from the main API
The serverless driver's main entry point is meant to mirror the native
@tursodatabase/database surface, which has no execute() — it exposes
prepare/run/get/all/iterate/exec/batch/pragma/transaction. Connection.execute()
was a libsql-client-ism on that surface, and it returned the raw protocol
result shape rather than the {changes, lastInsertRowid} / row-array contracts
the sibling methods use.

The libsql compatibility layer keeps its own execute(), which talks to
Session.execute() directly and never went through Connection.execute(), so the
compat surface is unaffected.

Tests: rewrote the serverless integration tests and the serverless-only
conformance tests against exec/run/get/all; tsc and the package build pass.
Both suites need a live TURSO_DATABASE_URL and were not run.
2026-07-20 18:29:15 +03:00
Nikita Sivukhin
b4bcdf0af6 Merge branch 'main' into fix-async-txn-ts-simple
# Conflicts:
#	testing/conformance/javascript/__test__/async.test.js
2026-07-17 16:14:08 +02:00
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
Nikita Sivukhin
a86208e996 wip 2026-07-17 14:59:46 +02:00
Pekka Enberg
cbfd05b1de serverless/javascript: fix stale inTransaction after execute and batch
The driver caches the server's get_autocommit answer to back the
synchronous Connection.inTransaction property, but only describe and
sequence refreshed it. execute() and batch() went through the cursor
endpoint, which cannot carry a get_autocommit probe, so the cached
flag went stale. After a raw BEGIN IMMEDIATE batch hit a constraint
error, the server-side write transaction stayed open (statement-level
ABORT) while inTransaction still read false, so cleanup code skipped
ROLLBACK and the leaked transaction starved every other writer until
timeout.

Learn the transaction state in-band instead: every cursor batch gets a
trailing SELECT 1 step gated on the is_autocommit condition. The
server executes the step only when the connection is in autocommit,
so its presence in the entry stream is the authoritative answer, with
no extra round trip and no change to the streaming transport. A shared
wrapper filters the probe's entries out of the stream and falls back
to a standalone get_autocommit pipeline request when the stream ends
abnormally (fatal error entry or the consumer stops iterating early),
where the probe answer is unreliable.

Non-atomic batch() now defers its first step error until the stream is
drained instead of throwing immediately, so the probe is still
observed; the server ran the remaining unconditioned steps either way,
so the observable semantics are unchanged.

With the flag accurate, an atomic batch inside a manually-opened
transaction now joins it (mode ignored) instead of failing on a nested
BEGIN, matching batch() inside transaction(); the conformance test
pinning the old failure mode now pins the join contract.

Tests: testing/conformance/javascript async.test.js and compat.test.js
(PROVIDER=turso, PROVIDER=serverless against sqld, including the
queryTimeout cases), serverless/javascript integration-tests, and a
direct check that a 20MB row-producing batch streams successfully.
2026-07-17 09:33:00 +03:00
Pekka Enberg
17f12b104c bindings/javascript: pin better-sqlite3 to 12.9.0
better-sqlite3 12.11.0 dropped its Node 20 (node-v115) prebuilt binaries
while still advertising engines.node "20.x", so `yarn install` on the
Node 20 CI runners falls back to compiling from source. That source build
is fragile across platforms: on macOS arm64 the bundled node-gyp@13 loads
an undici that calls webidl.util.markAsUncloneable (Node 22+ only) and
crashes, and on Windows older node-gyp can't detect the Visual Studio
version on the runner.

Pin better-sqlite3 to 12.9.0, the last release that publishes node-v115
prebuilds for every target platform (darwin-arm64/x64, win32-x64/arm64,
linux-x64/arm64, musl). With a prebuilt binary there is no source compile,
so node-gyp, Visual Studio, and undici never enter the picture.
2026-07-06 10:38:59 +03:00
Pekka Enberg
3a1d853d15 conformance/javascript: cover big integer round-trip with safe integers
Add a conformance test to the JavaScript async and sync suites that stores
i64::MAX, i64::MIN, and 2^53+1 and reads them back with safe integers
enabled, asserting exact BigInt round-trip. Verified against the turso and
better-sqlite3 providers.
2026-06-22 09:38:48 +03:00
Pekka Enberg
45e80cfe26 Return per-statement results from batch()
Make the JavaScript batch() return an array of ResultSet, one per input
statement, matching the libSQL client contract. Each ResultSet carries
that statement's columns, columnTypes, rows (with both positional and
named access), rowsAffected, and a BigInt lastInsertRowid.

Previously the native Database.batch() returned an aggregate
{ rowsAffected, lastInsertRowid } and discarded rows, while the
libSQL-compat client.batch() ignored statement args and collapsed all
statements into a single result. This reworks every layer:

- Native Database.batch() reads each statement's columns, collects rows
  in raw mode, and builds one ResultSet per statement.
- session.batch() requests rows (want_rows) and returns one raw result
  per statement, preserving the atomic Hrana condition chain.
- Connection.batch() shapes each result into a libSQL ResultSet.
- compat client.batch() binds args and runs the batch atomically.

Add conformance tests for both the native Database.batch() and the
libSQL-compat client.batch().
2026-06-18 09:09:38 +03:00
Pekka Enberg
17b772df5f Merge 'build(deps): bump ws from 8.20.0 to 8.21.0 in /testing/conformance/javascript' from app/dependabot
Bumps [ws](https://github.com/websockets/ws) from 8.20.0 to 8.21.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/websockets/ws/releases">ws's
releases</a>.</em></p>
<blockquote>
<h2>8.21.0</h2>
<h1>Features</h1>
<ul>
<li>Introduced the <code>maxBufferedChunks</code> and
<code>maxFragments</code> options (2b2abd45).</li>
</ul>
<h1>Bug fixes</h1>
<ul>
<li>Fixed a remote memory exhaustion DoS vulnerability (2b2abd45).</li>
</ul>
<p>A high volume of tiny fragments and data chunks could be sent by a
peer, using
modest network traffic, to crash a <code>ws</code> server or client due
to OOM.</p>
<pre lang="js"><code>import { WebSocket, WebSocketServer } from 'ws';
<p>const wss = new WebSocketServer({ port: 0 }, function () {
const data = Buffer.alloc(1);
const options = { fin: false };
const { port } = wss.address();
const ws = new WebSocket(<code>ws://localhost:${port}</code>);</p>
<p>ws.on('open', function () {
(function send() {
ws.send(data, options, function (err) {
if (err) return;
send();
});
})();
});</p>
<p>ws.on('error', console.error);
ws.on('close', function (code, reason) {
console.log(<code>client close - code: ${code} reason:
${reason.toString()}</code>);
});
});</p>
<p>wss.on('connection', function (ws) {
ws.on('error', console.error);
ws.on('close', function (code, reason) {
console.log(<code>server close - code: ${code} reason:
${reason.toString()}</code>);
});
});
</code></pre></p>
<p>The vulnerability was responsibly disclosed and fixed by <a
href="https://github.com/Nadav0077">Nadav Magier</a>.</p>
<p>In vulnerable versions, the issue can be mitigated by lowering the
value of the
<code>maxPayload</code> option if possible.</p>
<h2>8.20.1</h2>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/websockets/ws/commit/bca91adf15677e47dbe
4f959653452727be28b94"><code>bca91ad</code></a> [dist] 8.21.0</li>
<li><a href="https://github.com/websockets/ws/commit/2b2abd458a1b647d0b6
033bd62a619c36189839a"><code>2b2abd4</code></a> [security] Limit
retained message parts</li>
<li><a href="https://github.com/websockets/ws/commit/78eabe2a6677b231bf9
c82601bde86ff91639490"><code>78eabe2</code></a> [security] Add latest
vulnerability to SECURITY.md</li>
<li><a href="https://github.com/websockets/ws/commit/5d9b316230ea931532a
6671cc450f18c11edd02f"><code>5d9b316</code></a> [dist] 8.20.1</li>
<li><a href="https://github.com/websockets/ws/commit/c0327ec15a54d701eb6
ccefaa8bef328cfc03086"><code>c0327ec</code></a> [security] Fix
uninitialized memory disclosure in <code>websocket.close()</code></li>
<li><a href="https://github.com/websockets/ws/commit/ce2a3d62437995a47e6
056d485a33d21b6a8f867"><code>ce2a3d6</code></a> [ci] Test on node
26</li>
<li><a href="https://github.com/websockets/ws/commit/58e45b872bb0f35a3ed
d553c27e105300a4f5bd0"><code>58e45b8</code></a> [ci] Do not test on node
25</li>
<li><a href="https://github.com/websockets/ws/commit/5f26c245231a4b01847
9a9269e8c3da4773fe42f"><code>5f26c24</code></a> [ci] Run the lint step
on node 24</li>
<li>See full diff in <a
href="https://github.com/websockets/ws/compare/8.20.0...8.21.0">compare
view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility score](https://dependabot-
badges.githubapp.com/badges/compatibility_score?dependency-
name=ws&package-manager=npm_and_yarn&previous-version=8.20.0&new-
version=8.21.0)](https://docs.github.com/en/github/managing-security-
vulnerabilities/about-dependabot-security-updates#about-compatibility-
scores)
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/tursodatabase/turso/network/alerts).
</details>

Closes #7407
2026-06-09 12:42:43 +03:00
Pedro Muniz
7715979bd0 Merge 'Preserve JS row positional values' from Pedro Muniz
I think JS has problems overall. But my guess here is that there is some
positional property that we were not adding.
Closes https://github.com/tursodatabase/turso/issues/7278
Vibed as Im not quite a JS script kiddie

Reviewed-by: Mikaël Francoeur (@LeMikaelF)
Reviewed-by: Pekka Enberg <penberg@iki.fi>

Closes #7285
2026-06-08 16:22:28 -03:00
dependabot[bot]
72c576ce34 build(deps): bump ws in /testing/conformance/javascript
Bumps [ws](https://github.com/websockets/ws) from 8.20.0 to 8.21.0.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/8.20.0...8.21.0)

---
updated-dependencies:
- dependency-name: ws
  dependency-version: 8.21.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-08 15:03:11 +00:00
pedrocarlo
4c0febfed2 Preserve JS row positional values 2026-06-02 18:58:41 -03:00
Pekka Enberg
e5ddef05ed javascript: Fix Database.inTransaction property
Fix the inTransaction property to probe the database connection whether
it is in a transaction or not.
2026-06-01 18:36:54 +03: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
d03e864ae9 testing/conformance: Add JavaScript bind args test cases 2026-05-04 13:46:48 +03:00
Pekka Enberg
ad1fd4509b conformance/javascript: Update libsql package
Update to a version with the Database API changes.
2026-05-04 13:46:48 +03:00
dependabot[bot]
d3ba2efa8b build(deps-dev): bump js-yaml in /testing/conformance/javascript
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.14.1 to 3.14.2.
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/3.14.1...3.14.2)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-version: 3.14.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-03 06:33:22 +00:00
dependabot[bot]
ca3d7ae509 build(deps): bump tar-fs in /testing/conformance/javascript
Bumps [tar-fs](https://github.com/mafintosh/tar-fs) from 2.1.3 to 2.1.4.
- [Commits](https://github.com/mafintosh/tar-fs/compare/v2.1.3...v2.1.4)

---
updated-dependencies:
- dependency-name: tar-fs
  dependency-version: 2.1.4
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-28 10:19:32 +00:00
Pekka Enberg
4ddbc2a275 testing/conformance: Update libsql dependency 2026-04-28 11:33:39 +03:00
Pekka Enberg
6bdbacdd45 testing/conformance: Allow non-native errors in query timeout tests
ava's t.throws()/t.throwsAsync() validate the thrown value with
util.types.isNativeError(), which only returns true for objects whose
internal [[ErrorData]] slot was set by the Error constructor. libsql's
SqliteError uses the legacy `Error.call(this)` subclassing pattern (same
as better-sqlite3, the canonical Node SQLite API it mirrors), so its
instances pass `instanceof Error` but fail isNativeError. Pass
`{ any: true }` to bypass that check rather than diverging from the
canonical libsql/better-sqlite3 error shape.
2026-04-28 11:33:39 +03:00
Pekka Enberg
9ee0386373 Move JavaScript conformance tests 2026-04-28 10:42:58 +03:00