Introducing Read-Only Database Attach for SQLite in Turso
Turso 0.1.3 adds read-only `ATTACH DATABASE`, letting a single session join across multiple SQLite databases without SQLite's default limit of 10 attached databases (hard maximum 125). SQL examples cover shared reference data, archived per-year databases and cross-service reporting queries. Read-only mode avoids write locks and cross-database transaction coordination, and read-write support is planned. The release also fixes a WAL checkpoint write-amplification bug, reuses free space in B-tree pages, adds external sorting for ORDER BY on data larger than memory and speeds up connection time.
Related posts
- Turso v0.6.0
Turso mediumAdeptTurso 0.6 is the first release supporting all major SQLite features, adding experimental multi-process WAL access (OFD locks on Linux, fcntl elsewhere, IOCP on Windows) and VACUUM/VACUUM INTO. SQL additions include production-ready triggers, temp tables, virtual generated columns, CREATE TABLE AS SELECT, partial WITHOUT ROWID support, UPDATE...FROM, FILTER on aggregates, NULLS FIRST/LAST, and INDEXED BY hints. The STRICT type system gains arrays, structs/unions and Postgres-style domains, and MVCC logical logs are now encrypted with AEAD in 32 KiB chunks. SDK changes add query timeouts, async prepare, fixed interactive transactions in the serverless driver, an npm-distributed CLI and a SQLAlchemy asyncio dialect.
- How Turso made connections to SQLite databases 575x faster
Turso mediumAdeptSQLite re-reads and parses the sqlite_schema table on every new connection, so opening a connection to a database with 10,000 tables takes about 23ms. Turso, a Rust rewrite of SQLite, parses the schema once and shares it across connections in the same process. It uses Arc::make_mut copy-on-write, so a connection only clones the schema when it changes it inside a transaction, and committed changes propagate to all connections. New connections then open in about 40 microseconds no matter how many tables exist, which is faster even than SQLite's 130 microseconds for a single-table database.
- Turso v0.4.0
Turso mediumAdeptTurso v0.4.0 overhauls its experimental MVCC mode, which lifts SQLite's single-writer limit, adding index support, checkpointing and recovery. MVCC is now enabled with `PRAGMA journal_mode = 'experimental_mvcc'`, persisted in the file header, and makes the file unreadable by stock SQLite until you switch back to WAL. Partial sync fetches pages on demand, with bootstrap queries and prefetching (persistent mode is Linux-only because it needs sparse files), and sync now ships in the Python and Go SDKs. The release also adds page cache spilling for large queries, ANALYZE support for better join ordering, and a disk-spilling hash join for non-indexed columns in place of SQLite's ephemeral B-tree indexes.
- Bringing SQLite to Vercel Functions with Turso
Turso mediumAdeptTurso's partial sync replicates a subset of SQLite database pages into Vercel Functions so reads run in-process with no network round-trip, while writes go to the remote Turso database for durability and consistency. On cold start the driver fetches the first 128 KiB of the SQLite file, then pulls further 128 KiB segments on demand into the ephemeral /tmp directory, so cold-start cost scales with the working set rather than total database size. The experimental @tursodatabase/vercel-experimental package also auto-provisions databases by name for database-per-tenant or per-agent-session patterns. It offers an optional local-write batching mode that trades consistency for lower write latency, and uses a waitUntil() safety net that pushes pending changes if close() is forgotten.
- Turso v0.7.0
Turso hardMasterTurso 0.7 drops the beta label and focuses on performance and robustness for embedded, multi-tenant use: the core no longer blocks on I/O, yields CPU via a new StepResult::Yield, moves to fallible allocation so OOM surfaces as an error, and treats the page cache as a soft limit like SQLite. The MVCC engine gets a linear-merge dual cursor that replaces per-row skiplist lookups (about a quarter of CPU time on write-heavy loads), watermark-driven garbage collection, experimental passive checkpoints that don't stop the world, and smaller row versions. SQL additions include PostgreSQL-style sequences (now backing AUTOINCREMENT), ICU collations, REINDEX, ordered-set aggregates and window-function groundwork. The SDKs gain a SQLite-compatible .NET/EF Core provider, GIL release and FTS in Python, and concurrent transactions in JavaScript.