Working offline mode, + synchronization (ionic 3)


#1

Hi everybody,
I am developing an app in ionic3 framework and i want to use PostgreSQL as database. I want to work my app on offline (sqlite) and sync the data to my database.I found PouchDB which works as a local storage and sync with CouchDB(NoSQL solution) . there is any other local storage which work offline and sync with postgresql data base ?, (documentation,tutorials,…)


#2

Hi, @pierreLitto please refer this tutorial for offline sync data


#3

thx… but it’s a NoSQL solution !!


#4

@pierreLitto For MySQL, you have to use ionic SQLite plugin for offline sync.

I have suggested this tutorial follow for MySQL database


#5

thank you ,… but this tutorial … just for local Storage with sqlite (=offline ), I’m looking for a way to sync my data to PosgreSql database(=onlline mode )


#6

@pierreLitto, For sync data from the offline database to online you have to add boolean type field like(isSync BOOLEAN) in the offline database table and append false value by default. when your app is online gets all isSync false data and passing all the data in API and after successfully call API you need to change isSync value to true


#8

You could potentially do a “facade” service that acts as couchdb and then your node.js translates required actions to persistence (PostGres etc). But I am not aware of anyone in production who did that and is happy with it.


#9

You can try: http://docs.sqlite-sync.com/