Re: [PhoneGap] Is a Relational Database Available?

300 views
Skip to first unread message

Shazron

unread,
Nov 15, 2012, 5:09:41 AM11/15/12
to phonegap
Most people use WebSQL, although that is deprecated now (IndexedDB is the future, but broad support is not there yet):
http://www.html5rocks.com/en/tutorials/webdatabase/websql-indexeddb/

WebSQL is "included" in the embedded browsers we use for the platforms and has broad support.


On Wed, Nov 14, 2012 at 11:53 AM, John Fowler <john.f...@gmail.com> wrote:
Disclaimer: I am new to PhoneGap, and have not _YET_ used it to create an app.  It looks awesome...  I am genuinely very, very impressed.

As I'm evaluating PhoneGap for creating business apps (or any type of app for that matter), I have a couple of simple questions:
  1. Is there a Relational Database that can be used reliably across all platforms?  
  2. Does a Relational Database require additional software to be installed on the device?
  3. Does the Relational Database have the same functionality across all devices, so that if it works in one, it will work in all?

I ask for two reasons:  I want to understand exactly how a Relational Database can be used to store data locally on the device,  and also because I am part of a company called SequelSphere.  SequelSphere is a brand new company that creates an HTML5 / JavaScript relational database engine that might work extremely well with PhoneGap. I'd like to understand what the opportunity is.

Thanks in advance,

john...


--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
 
To compile in the cloud, check out build.phonegap.com
 
 

WebSteve

unread,
Nov 15, 2012, 10:36:40 AM11/15/12
to phon...@googlegroups.com
PhoneGap provides the Storage API across all supported mobile devices:

http://docs.phonegap.com/en/2.2.0/index.html

Regards,

Steve H

John Fowler

unread,
Nov 16, 2012, 8:55:24 AM11/16/12
to phon...@googlegroups.com
Thanks for the responses.

Raymond Camden

unread,
Nov 26, 2012, 9:17:15 AM11/26/12
to phon...@googlegroups.com
I think one thing to keep in mind is that WebSQL is not meant to be a replacement for an Enterprise SQL system. That would be a bit impractical. That being said, as a single user db, it's really darn useful to have available within your application. (Btw, not saying FKs don't exist, just trying to manage expectations. ;)

On Monday, November 26, 2012 5:29:45 AM UTC-6, dns sandas wrote:
Does it allow PRAGMA calls from within Phonegap (since from html that's not possible)? I want to activate foreign keys! :(


Chris Brody

unread,
Nov 26, 2012, 1:53:38 PM11/26/12
to phon...@googlegroups.com
You can try a sqlite plugin at https://github.com/davibe/Phonegap-SQLitePlugin that should support a PRAGMA call in db.executeSql(). I made a fork to emulate the HTML5 SQL API more closely but certain pragma calls will not work from within an open transaction.

Chris


On Monday, November 26, 2012 12:29:45 PM UTC+1, dns sandas wrote:
Does it allow PRAGMA calls from within Phonegap (since from html that's not possible)? I want to activate foreign keys! :(

Cheers

Chris Brody

unread,
Nov 30, 2012, 11:17:58 AM11/30/12
to phon...@googlegroups.com
The sqlite plugin basically gives you much better control of the database file, which gives you several advantages. The built-in WebSQL has an imposed database file size limit, while the sqlite plugin does not have this limitation. Also, there had been issues in the past with the iOS version where the WebSQL database would not be backed up by the iCloud, and recently there were more discussions about problems with data loss and CB-1561 (use of Storage API rejected by Apple).

I have made a fork with adaptations to follow the HTML5 SQL API more closely and also a version for the Android. Some people are already trying these versions with SQLCipher encryption. I am getting ready to move the iOS and Android versions into separated projects, for now you can find my fork at: https://github.com/chbrody/Cordova-SQLitePlugin

Chris

On Friday, November 30, 2012 2:58:01 PM UTC+1, Alex Oliveira wrote:
Sorry for the beginner's question, but why should I use this plugin instead of the build-in support of PhoneGap? Is it related to some restriction, limitation (max size of db, maybe?). Can you clarify that scenario?

Thanks

Alex Oliveira

unread,
Nov 30, 2012, 2:45:27 PM11/30/12
to phon...@googlegroups.com
The plugin really looks very promising, thanks for sharing.
I'll evaluate it for a upcoming project.

Alex
Reply all
Reply to author
Forward
0 new messages