Drop the wire-level every-request detail and the PROTOCOL.md reference
from user-facing driver docs, and use named return parameters in the Go
parseDSN to disambiguate the three returned strings.
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.