react-native-sync
Advanced tools
Comparing version
{ | ||
"name": "react-native-sync", | ||
"version": "1.0.3", | ||
"description": "Two way, incremental sync between React Native realmjs database and MySQL, Oracle, MS SQL Server and PostgreSQL", | ||
"version": "1.0.4", | ||
"description": "Two way, incremental sync between React Native realmjs databases and MySQL, Oracle, MS SQL Server and PostgreSQL databases.", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
# react-native-sync | ||
Two way, incremental sync between React Native realmjs database and MySQL, Oracle, MS SQL Server and PostgreSQL | ||
Two way, incremental sync between React Native realmjs databases and MySQL, Oracle, MS SQL Server and PostgreSQL databases. | ||
@@ -23,34 +23,34 @@ ## Features | ||
```javascript | ||
import RNSync from "react-native-sync"; | ||
``` | ||
```javascript | ||
import RNSync from "react-native-sync"; | ||
``` | ||
2. Configure RNSync: | ||
```javascript | ||
var settings = { | ||
syncServerUrl: "http://localhost:8080/pervasync/server", // required | ||
syncUserName: "user_1", // required | ||
syncUserPassword: "welcome1", // required | ||
}; | ||
await RNSync.config(settings); | ||
``` | ||
```javascript | ||
var settings = { | ||
syncServerUrl: "http://localhost:8080/pervasync/server", // required | ||
syncUserName: "user_1", // required | ||
syncUserPassword: "welcome1", // required | ||
}; | ||
await RNSync.config(settings); | ||
``` | ||
3. Start a sync session: | ||
```javascript | ||
let syncSummary = await RNSync.sync(); | ||
``` | ||
```javascript | ||
let syncSummary = await RNSync.sync(); | ||
``` | ||
4. Get a handle to the synced realm database and synced folder path: | ||
```javascript | ||
let realm = await RNSync.getRealm(syncSchemaName); | ||
let path = await RNSync.getPath(syncFolderName); | ||
``` | ||
```javascript | ||
let realm = await RNSync.getRealm(syncSchemaName); | ||
let path = await RNSync.getPath(syncFolderName); | ||
``` | ||
## Complete Example | ||
Check out [react-native-sync-demo](https://github.com/pervasync/react-native-sync-demo) ans expecially [sync.js](https://github.com/pervasync/react-native-sync-demo/blob/master/sync.js) | ||
Check out [react-native-sync-demo](https://github.com/pervasync/react-native-sync-demo) and expecially [sync.js](https://github.com/pervasync/react-native-sync-demo/blob/master/sync.js) | ||
143301
0.07%