State the parity requirement in the serverless differential conformance
spec — each serverless driver exposes the same public API as its
language's embedded driver, and non-JavaScript serverless drivers track
the JavaScript driver's capabilities — and reference it from the
AGENTS.md core principles.
Add the param_batch operation to the shared vocabulary (spec/ops.json,
documented in operations.md) and implement it in the JavaScript,
Python, and Rust harnesses: 1-4 statements through the batch() API —
parameterized INSERTs drawing from the adversarial value pool, SELECTs,
and statements from error_sqls — optionally atomic via a mode of
deferred or immediate. The embedded and serverless drivers must agree
on every statement's result; on failure they must agree on the failing
statement's index and on the per-statement results carried by the
error, entry by entry. An agreed batch failure leaves well-defined
state, so the harnesses keep comparing later operations — that is what
catches an atomic batch that reports the right index but fails to roll
back. The server-side execution statistics are excluded from the
comparison: the serverless driver reports them and the embedded driver
does not, by design.
The embedded drivers execute a batch as a sequential loop that stops at
the first error, so the comparison is the oracle for the serverless
batch: one pipeline request must behave exactly like sequential
execution that stops at the first failure.
The Rust generator fails the suite deterministically, with an
actionable message, when ops.json contains an operation it does not
implement, instead of panicking mid-case on an unknown id.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Only the JavaScript serverless driver supported a remote encryption key,
sent as the x-turso-encryption-key header. Add the same support to the
Go, Python, and Rust drivers:
- Go: remote_encryption_key DSN parameter and
Connector.WithRemoteEncryptionKey
- Python: connect(remote_encryption_key=...)
- Rust: Builder::with_remote_encryption_key
Document the header in PROTOCOL.md section 3.1 and make it an enforced
property: the shared differential spec gains a tests.encryption_header
entry, and every harness now runs a property test against a local stub
HTTP server asserting that a driver configured with a key attaches the
header to every request on both the pipeline and cursor endpoints, and
that a driver without a key never sends it. These tests need no Turso
Cloud database and never skip.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Implement the client side of the SQL over HTTP protocol
(serverless/PROTOCOL.md) so Python applications can talk to Turso Cloud
from serverless and edge environments, where the only networking
primitive is an HTTP request. The driver is pure Python on top of
urllib, implements DB-API 2.0, and mirrors the embedded turso driver,
so the same code runs against a local database or Turso Cloud.
The session layer follows the JavaScript and Rust serverless drivers:
the baton is tracked on every request, transaction state comes from the
server's authoritative get_autocommit answer piggybacked on every
pipeline (and an is_autocommit-gated probe step on cursor batches), and
statements run over the cursor endpoint. Pipeline responses are
validated to carry one result per request. A failed request is never
transparently retried: the stream is reset and the error surfaces, so
the application decides whether re-running a statement is safe.
Server-returned base URLs go through the same normalization as
user-supplied ones, including trailing-slash stripping.
The conformance suite runs against a live database configured with
TURSO_DATABASE_URL and TURSO_AUTH_TOKEN and skips when they are unset,
covering queries, parameter binding, value round-trips, transactions,
executescript, and DB-API error mapping.
Tests: pytest in serverless/python; protocol and URL handling unit
tests run standalone, the conformance suite needs the environment
variables set.