PersistenceJS with PhoneGap SQLite plugins

1,060 views
Skip to first unread message

Shyam Nagarajan

unread,
Jun 21, 2013, 12:33:34 PM6/21/13
to persis...@googlegroups.com
I have been using PersistenceJS with WebSQL and it works great in a PhoneGap mobile app. In one of the scenarios I want to execute a formula that has database lookup functions. I would like to convert this into a synchronous call. I figured out the WebSQL API is completely asynchronous and hence you cant have a synchronous call using PersistenceJS and WebSQL.

I found a few PhoneGap SQLite plugins that provide synchronous access to SQLite. These plugins give the same interface as that of WebSQL. I was wondering if I can use PersistenceJS with these plugins. Has anyone tried this out? Is this possible? Are there any pitfalls?

Zef Hemel

unread,
Jun 21, 2013, 1:19:05 PM6/21/13
to persis...@googlegroups.com
Yes, this is perfectly possible, even without using the WebSQL wrappers. The titanium back-end does the same thing, converting the synchronous Titanium SQLite interface to an asynchronous one that works with persistence.js: https://github.com/zefhemel/persistencejs/blob/master/lib/persistence.store.titanium.js

-- Zef


On Fri, Jun 21, 2013 at 12:33 PM, Shyam Nagarajan <sund...@gmail.com> wrote:
I have been using PersistenceJS with WebSQL and it works great in a PhoneGap mobile app. In one of the scenarios I want to execute a formula that has database lookup functions. I would like to convert this into a synchronous call. I figured out the WebSQL API is completely asynchronous and hence you cant have a synchronous call using PersistenceJS and WebSQL.

I found a few PhoneGap SQLite plugins that provide synchronous access to SQLite. These plugins give the same interface as that of WebSQL. I was wondering if I can use PersistenceJS with these plugins. Has anyone tried this out? Is this possible? Are there any pitfalls?

--
You received this message because you are subscribed to the Google Groups "persistence.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to persistencej...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

p.de...@themangomedia.com

unread,
Sep 3, 2013, 12:34:58 AM9/3/13
to persis...@googlegroups.com
Hi Shyam,

Iam working in Project to Synchronize Mysql Db to Phonegap WebSQL Db, i have Refereed some links. in that PersistenceJS is effective to one, i need to one way syncronization.. from phonegap app to check database changes , if its changed, need to update in WebSql in Mobile App, if you have any Open Resource to this Requirement , Make A share..

Thanks,
Deepan Palaniappan,
7401192800
Reply all
Reply to author
Forward
0 new messages