Introducing React Native Bindings for Turso
`@tursodatabase/sync-react-native` is a single package that gives React Native apps on iOS and Android an embedded, SQLite-compatible Turso database plus optional bidirectional sync with Turso Cloud via `pull` and `push`, enabling offline-first apps. The native JSI layer is kept thin as a bridge to SDK-KIT, while async network IO and SDK logic live in TypeScript; this makes debugging, unit testing and iteration easier without native rebuilds. The bindings require React Native 0.76+ with the New Architecture and iOS 13.0+. Partial sync, an Expo plugin and real-time subscriptions are planned.
Related posts
- Building Local-First Apps: The Complete Guide to Offline-First Database Sync
Turso mediumAdeptTurso Sync brings local-first behaviour to SQLite-based apps. Local changes are captured via change data capture and pushed as logical row-level mutations, while remote changes are pulled as physical pages so replicas converge byte-for-byte. Turso's benchmarks report up to 312x faster syncs and roughly 18x less traffic than the older Embedded Replicas approach. The guide covers TypeScript setup with background push/pull loops, Last-Push-Wins conflict resolution and a transform hook for custom merges such as turning sets into increments, scoped auth tokens and JWKS, sync-aware WAL checkpointing, and experimental partial sync. It also notes that there is no CRDT or peer-to-peer support, which makes the approach a poor fit for real-time collaborative document editing.
- Toasty now fully supports Turso
Turso mediumAdeptToasty, the async Rust ORM from Tokio's creator, now supports Turso in three modes behind one API: local files with optional concurrent writes (transactions automatically wrapped in BEGIN CONCURRENT), a serverless remote mode over HTTP with URL and auth token, and local-first sync with explicit pull/push calls. Only the driver constructor changes between modes, so the same models and queries run unchanged. For remote use, toasty::batch() combines independent statements into one round trip and returns typed tuple results, avoiding a network round trip per transaction statement.
- Introducing Databases Anywhere with Turso Sync
Turso mediumAdeptTurso Sync lets local SQLite-compatible Turso databases, in Node or in the browser via WASM, sync with Turso Cloud through push, pull and sync-aware checkpoint methods layered on the standard database API. Local changes are pushed as row-level logical mutations with Last-Push-Wins conflict resolution, and a transform hook lets developers rewrite mutations for custom merge logic. Remote changes are pulled as physical pages, so replicas converge byte-for-byte on the cloud source of truth, which rules out peer-to-peer sync. The launch also adds per-table, per-operation token permissions and external JWKS/OIDC auth (Clerk and Auth0 in beta).
- Introducing Turso in the Browser
Turso mediumAdeptTurso, a from-scratch SQLite rewrite, now runs in the browser via WebAssembly as the npm package @tursodatabase/database-wasm, with a better-sqlite3-like API whose methods are all async because of OPFS. Query compute runs on the main UI thread, since benchmarks showed offloading to a worker cost too much in communication overhead. A Web Worker handles filesystem I/O through the synchronous OPFS interface and shares buffers with the main thread via SharedArrayBuffer, which requires COOP/COEP headers and locks a database to one tab. The code is compiled to wasm32-wasip1-threads with napi-rs v3, and there are dedicated Vite and Turbopack exports plus a CDN build that inlines the WASM as base64 at the cost of a larger bundle.
- 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.