Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for offline writes #287

Merged
merged 1 commit into from
Nov 15, 2024
Merged

Add support for offline writes #287

merged 1 commit into from
Nov 15, 2024

Conversation

penberg
Copy link
Contributor

@penberg penberg commented Nov 15, 2024

This bumps up the libsql package dependency and adds a "offline" flag to config, which enables offline writes with sync to remote:

Configuration is straight-forward:

const config = {
    url: process.env.URL ?? "file:local.db",
    syncUrl: process.env.SYNC_URL,
    authToken: process.env.AUTH_TOKEN,
    offline: true,
};
const db = createClient(config);

This puts the database in a mode where writes are always local and sync() pushes changed frames to remote server.

This bumps up the libsql package dependency and adds a "offline" flag to
config, which enables offline writes with sync to remote:

Configuration is straight-forward:

```
const config = {
    url: process.env.URL ?? "file:local.db",
    syncUrl: process.env.SYNC_URL,
    authToken: process.env.AUTH_TOKEN,
    offline: true,
};
const db = createClient(config);
```

This puts the database in a mode where writes are always local and
`sync()` pushes changed frames to remote server.
@penberg penberg merged commit d6ec43f into main Nov 15, 2024
6 checks passed
@penberg penberg deleted the offline-writes branch November 15, 2024 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants