Files
turso/serverless/javascript/examples/cloud-encryption
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
..

Cloud Encryption Example

This smoll example shows how to connect to an encrypted Turso Cloud database.

Prerequisites

You need a Turso Cloud database with encryption enabled. Refer to the documentation here for instructions.

Running

npm i
export TURSO_DATABASE_URL="libsql://your-db.turso.io"
export TURSO_AUTH_TOKEN="your-auth-token"
export TURSO_REMOTE_ENCRYPTION_KEY="base64-encoded-key"
node index.mjs