Two way, incremental sync between React Native realmjs database and MySQL, Oracle, MS SQL Server and PostgreSQL
Switch branches/tags
Nothing to show
Clone or download
Latest commit 1717763 Mar 23, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.eslintrc.json Initial source commit Mar 18, 2018
.gitignore Initial source commit Mar 18, 2018
LICENSE Initial commit Mar 17, 2018
README.md Update README.md Mar 23, 2018
agent.js Shared realm Mar 19, 2018
context.js Shared realm Mar 19, 2018
db.js Initial source commit Mar 18, 2018
fs.js Initial source commit Mar 18, 2018
index.js Export agent schemas and folders Mar 18, 2018
package.json Version set to 1.0.3 Mar 21, 2018
setup.js Initial source commit Mar 18, 2018
transport.js Initial source commit Mar 18, 2018
util.js Initial source commit Mar 18, 2018

README.md

react-native-sync

Two way, incremental sync between React Native realmjs database and MySQL, Oracle, MS SQL Server and PostgreSQL

Features

  • Direct DB synchronization between on device realmjs DB and server side MySQL, Oracle, MS SQL Server and PostgreSQL databases
  • Each user could subscribe to a subset of server side data
  • Files can also be syned

Demo

Check out react-native-sync-demo.

Setup

This library is available on npm, install it with: npm install --save react-native-sync or yarn add react-native-sync.

Usage

  1. Import react-native-sync as RNSync:
import RNSync from "react-native-sync";
  1. Configure RNSync:
var settings = {
    syncServerUrl: "http://localhost:8080/pervasync/server", // required
    syncUserName: "user_1", // required
    syncUserPassword: "welcome1", // required
};
await RNSync.config(settings);
  1. Start a sync session:
let syncSummary = await RNSync.sync();
  1. Get a handle to the synced realm database and synced folder path:
let realm = await RNSync.getRealm(syncSchemaName);
let path = await RNSync.getPath(syncFolderName);

Complete Example

Check out react-native-sync-demo and expecially sync.js