@tursodatabase/sync 0.1.4-pre.6 → 0.1.4-pre.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1 +1,60 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<h1 align="center">Turso Sync for JavaScript</h1>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a title="JavaScript" target="_blank" href="https://www.npmjs.com/package/@tursodatabase/sync"><img alt="npm" src="https://img.shields.io/npm/v/@tursodatabase/sync"></a>
|
|
7
|
+
<a title="MIT" target="_blank" href="https://github.com/tursodatabase/turso/blob/main/LICENSE.md"><img src="http://img.shields.io/badge/license-MIT-orange.svg?style=flat-square"></a>
|
|
8
|
+
</p>
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a title="Users Discord" target="_blank" href="https://tur.so/discord"><img alt="Chat with other users of Turso on Discord" src="https://img.shields.io/discord/933071162680958986?label=Discord&logo=Discord&style=social"></a>
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## About
|
|
16
|
+
|
|
17
|
+
This package is for syncing local Turso databases to the Turso Cloud and back.
|
|
18
|
+
|
|
19
|
+
> **⚠️ Warning:** This software is ALPHA, only use for development, testing, and experimentation. We are working to make it production ready, but do not use it for critical data right now.
|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install @tursodatabase/sync
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Getting Started
|
|
28
|
+
|
|
29
|
+
To sync a database hosted at [Turso Cloud](https://turso.tech):
|
|
30
|
+
|
|
31
|
+
```js
|
|
32
|
+
import { connect } from '@tursodatabase/sync';
|
|
33
|
+
|
|
34
|
+
const db = await connect({
|
|
35
|
+
path: 'local.db', // path used as a prefix for local files created by sync-engine
|
|
36
|
+
url: 'https://<db>.turso.io', // URL of the remote database: turso db show <db>
|
|
37
|
+
authToken: '...', // auth token issued from the Turso Cloud: turso db tokens create <db>
|
|
38
|
+
clientName: 'turso-sync-example' // arbitrary client name
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// db has same functions as Database class from @tursodatabase/database package but adds few more methods for sync:
|
|
42
|
+
await db.pull(); // pull changes from the remote
|
|
43
|
+
await db.push(); // push changes to the remote
|
|
44
|
+
await db.sync(); // pull & push changes
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Related Packages
|
|
48
|
+
|
|
49
|
+
* The [@tursodatabase/database](https://www.npmjs.com/package/@tursodatabase/database) package provides the Turso in-memory database, compatible with SQLite.
|
|
50
|
+
* The [@tursodatabase/serverless](https://www.npmjs.com/package/@tursodatabase/serverless) package provides a serverless driver with the same API.
|
|
51
|
+
|
|
52
|
+
## License
|
|
53
|
+
|
|
54
|
+
This project is licensed under the [MIT license](../../LICENSE.md).
|
|
55
|
+
|
|
56
|
+
## Support
|
|
57
|
+
|
|
58
|
+
- [GitHub Issues](https://github.com/tursodatabase/turso/issues)
|
|
59
|
+
- [Documentation](https://docs.turso.tech)
|
|
60
|
+
- [Discord Community](https://tur.so/discord)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tursodatabase/sync",
|
|
3
|
-
"version": "0.1.4-pre.
|
|
3
|
+
"version": "0.1.4-pre.8",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/tursodatabase/turso"
|
|
@@ -60,9 +60,9 @@
|
|
|
60
60
|
"@tursodatabase/database": "~0.1.4-pre.5"
|
|
61
61
|
},
|
|
62
62
|
"optionalDependencies": {
|
|
63
|
-
"@tursodatabase/sync-linux-x64-gnu": "0.1.4-pre.
|
|
64
|
-
"@tursodatabase/sync-win32-x64-msvc": "0.1.4-pre.
|
|
65
|
-
"@tursodatabase/sync-darwin-universal": "0.1.4-pre.
|
|
66
|
-
"@tursodatabase/sync-wasm32-wasi": "0.1.4-pre.
|
|
63
|
+
"@tursodatabase/sync-linux-x64-gnu": "0.1.4-pre.8",
|
|
64
|
+
"@tursodatabase/sync-win32-x64-msvc": "0.1.4-pre.8",
|
|
65
|
+
"@tursodatabase/sync-darwin-universal": "0.1.4-pre.8",
|
|
66
|
+
"@tursodatabase/sync-wasm32-wasi": "0.1.4-pre.8"
|
|
67
67
|
}
|
|
68
68
|
}
|