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

Remote

This example demonstrates how to use Turso Cloud.

Install Dependencies

npm i

Running

Execute the example:

TURSO_DATABASE_URL="..." TURSO_AUTH_TOKEN="..." node index.mjs

This will connect to a remote SQLite database, insert some data, and then query the results.