Starting a new project? Use
tursogo for local/embedded use or sync. For remote access, match the driver to the database engine: tursogo-serverless for Turso databases, libsql-client-go for libSQL databases. None of these require CGO.
tursogo
For local and embedded use. Built on the Turso Database engine with concurrent writes (MVCC) and async I/O.Installing
Connecting
Querying
Encryption
Encrypt local databases at rest using DSN options:aegis256, aegis256x2, aegis128l, aegis128x2, aegis128x4, aes256gcm, aes128gcm.
Encrypted databases cannot be read as standard SQLite databases — you must use the Turso Database engine to open them.
Turso Cloud databases can also be encrypted with bring-your-own-key — learn more.
Sync (Push and Pull)
For local database with cloud sync. All reads and writes happen locally; usePush() to send changes to the cloud and Pull() to fetch remote changes.
Push and Pull
Checkpoint
Compact the local WAL to bound disk usage while preserving sync state:Stats
libsql-client-go (Remote)
The recommended package for any application that connects to a remote Turso Cloud database over the network — web servers, Docker containers, serverless functions. Pure Go, no native dependencies.Installing
Connecting
Querying
Uses the standarddatabase/sql interface — same as tursogo:
go-libsql (libSQL)
Thego-libsql package is built on libSQL, the open-source fork of SQLite that powers Turso Cloud today. It is production-ready and battle-tested, and is the right choice when you are working with an existing go-libsql-based codebase.
With
go-libsql Embedded Replicas, reads are local and writes are sent to the cloud primary, then reflected back to the replica. Embedded Replicas are fully supported. For new projects that need sync, we recommend tursogo with NewTursoSyncDb — see the quickstart.Embedded Replicas
For workloads that need offline writes, bidirectional sync, or multi-writer convergence, we recommend
tursogo with NewTursoSyncDb — both reads and writes are local, and you sync explicitly with Push() / Pull().Manual Sync
Periodic Sync
Read Your Writes
By default, after a sync the server must fully catch up with your changes before returning — guaranteeing you always read your own writes. This is safer but much slower, since the server must process all pending changes. If you can tolerate eventually-consistent reads, disable this for significantly faster syncs:Encryption
To enable encryption on a SQLite file, pass the encryption key value as an argument to the constructor:Encrypted databases appear as raw data and cannot be read as standard SQLite databases. You must use the libSQL client for any operations — learn more.