1

I've just finished reading the documentation here:

http://docs.phonegap.com/en/edge/cordova_storage_storage.md.html#Storage,

and I have numerous questions that I can't find good answers to:

  1. What, if any, are the size limits to creating a new SQL Lite Database? (iOS and Android in particular)

  2. Where is the database stored on my local machine while I'm developing?

  3. How does one destroy a database if it's no longer needed?

  4. What, if any, are the advantages to using localStorage over the SQL Lite Database?

If anyone could help out I'd be obliged!

kylex
  • 14,178
  • 33
  • 114
  • 175

2 Answers2

2

Iam trying to answer your questions

Question 1.

 var db = window.openDatabase(database_name, database_version, database_displayname, database_size);

you can specify the database size in above code, the size of the database in bytes.

Question.2

Database will be created when you are running it on simulator or browser, you can see it (i usually do like this) right click on browser you are running --> Inspect element --> Resources --> WebSQL (i have tested with chrome and safari, it helped me).

Question.3

you can destroy by using drop command as shown,

 tx.executeSql('DROP TABLE IF EXISTS TableName');

Question.4

check this and this

UPDATE

(1).you can read about sqlite size limits (all details from sqlite itself) here and here a question from SO.

(2).I think you need this one.

(3).check this to know how to drop your database.

Community
  • 1
  • 1
Mumthezir VP
  • 6,251
  • 6
  • 28
  • 57
  • Hey @mvp, thanks for the answers but I think they missed some of the points. For #1, I need to know if there is a limit to the size or not. There's a lot of conflicting documentation that says there is a limit to the size but I can't find anything definitive. For #2, I need to know the physical location on the drive, #3 is dropping a table, not a database. Thanks though! – kylex Jul 24 '13 at 16:08
2

Question 2

If you're using a Mac and the simulator through XCode, the LocalStorage / SQLite database is stored here;

/Users/{your name}/Library/Application Support/iPhone Simulator/{version}/Applications/{app id}/Library/WebKit/LocalStorage/file__0/0000000000000001.db

I recommend SQLite Professional through the app store - the read-only version is free.


In Windows using Chrome, the databases are stored in;

C:\Users{your name}\AppData\Local\Google\Chrome\User Data\Default\databases\

C:\Documents and Settings{your name}\Local Settings\Application Data\Google\Chrome\User Data\Default\databases

I'd recommend SQLite Database Browser

Community
  • 1
  • 1
olimortimer
  • 1,373
  • 10
  • 23