limbo/bindings/javascript/sync
Preston Thorpe 73289c6325
Merge 'Go driver' from Nikita Sivukhin
This PR brings back go driver to the turso monorepo and adds sync
support for the golang.
It depends on the pre-compiled binaries at
https://github.com/tursodatabase/turso-go-platform-libs repository
There is a CI which trigger build on the turso-go-platform-libs repo in
case when release tag is published

Reviewed-by: Preston Thorpe <preston@turso.tech>

Closes #4085
2025-12-11 09:52:15 -05:00
..
packages Merge 'Go driver' from Nikita Sivukhin 2025-12-11 09:52:15 -05:00
src fix js naming 2025-12-11 14:43:28 +04:00
build.rs opfs for sync in one commit! 2025-09-10 22:35:57 +04:00
Cargo.toml fix clock implementation for OPFS IO 2025-09-19 13:21:00 +04:00
README.md Beta 2025-10-01 07:18:25 +03:00

Turso Sync for JavaScript

npm

Chat with other users of Turso on Discord


About

This package is for syncing local Turso databases to the Turso Cloud and back.

⚠️ Warning: This software is in BETA. It may still contain bugs and unexpected behavior. Use caution with production data and ensure you have backups.

Installation

npm install @tursodatabase/sync

Getting Started

To sync a database hosted at Turso Cloud:

import { connect } from '@tursodatabase/sync';

const db = await connect({
    path: 'local.db',                // path used as a prefix for local files created by sync-engine
    url: 'https://<db>.turso.io',    // URL of the remote database: turso db show <db>
    authToken: '...',                // auth token issued from the Turso Cloud: turso db tokens create <db>
    clientName: 'turso-sync-example' // arbitrary client name
});

// db has same functions as Database class from @tursodatabase/database package but adds few more methods for sync:
await db.pull(); // pull changes from the remote
await db.push(); // push changes to the remote
await db.sync(); // pull & push changes

License

This project is licensed under the MIT license.

Support