Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have developed a generic sync solution called <strong>WebSqlSync</strong>. </p> <p>It's not dependant of any framework. It's available here : <a href="https://github.com/orbitaloop/WebSqlSync" rel="noreferrer">https://github.com/orbitaloop/WebSqlSync</a></p> <p>Extract of the README file :</p> <h1>WebSqlSync</h1> <p>Automatically synchronize a local WebSql database (SQLite in the navigator) to a server. (2 way sync : client &lt;-> server)</p> <p>Very easy to integrate to your existing app and very easy to use (2 functions to call : initSync and syncNow)</p> <h1>Usage</h1> <h2>Initialize</h2> <p>You need to initialize the lib (at each startup for example).</p> <p>It will automatically create 2 tables (if they don't already exists, one to store all the new or modified elements (table new_elem) and one to store the date of the last sync (table sync_info). It will also create SQLite triggers in order to watch the INSERT or UPDATE on the tables you want to synchronize (to automatically insert the modified elements in the new_elem table):</p> <pre><code>DBSYNC.initSync(TABLES_TO_SYNC, webSqlDb, sync_info, 'http://www.myserver.com', callBackEndInit); </code></pre> <p>Where TABLES_TO_SYNC is the list of table that you want to sync with the server, ex :</p> <pre><code>TABLES_TO_SYNC = [ {tableName : 'table1', idName : 'the_id'}, {tableName : 'table2'} //if idName not specified, it will assume that it's "id" ]; </code></pre> <h2>Synchronize</h2> <p>To start the synchronization, you need to call the syncNow function. You can call it every X seconds, or after some changes for example :</p> <pre><code>DBSYNC.syncNow(callBackSyncProgress, function(result) { if (result.syncOK === true) { //Synchronized successfully } }); </code></pre> <p>And that's all you need to do on the client. On the server side, you will need to code your own solution (but it's not complicated). And there are some example inPHP &amp; Java. Again, contributions are welcome.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload