Giter Site home page Giter Site logo

daastrading / react-native-sync Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pervasync/react-native-sync

0.0 0.0 0.0 170 KB

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

License: MIT License

JavaScript 100.00%

react-native-sync's Introduction

react-native-sync

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

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

Setup

For end-to-end testing, you need to first setup a Pervasync server and publish your central database tables for sync. See Pervasync documentation for instructions.

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";
  2. Configure RNSync:

    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:

    let syncSummary = await RNSync.sync();
  4. 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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.