I can not find a normal literature about this. The site indicates how to work with the already created database. But the question is how to create it and enter data into it? Thank.

Closed due to the fact that off-topic participants Regent , Peter Olson , xaja , Aries , Cyrus 15 Oct '15 at 14:57 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • " Questionnaires are forbidden on Stack Overflow in Russian . To get an answer, rephrase your question so that it can be given an unambiguously correct answer." - Regent, Peter Olson, xaja, Aries
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • 3
    In OpenDatabase you specify the name of the database, if such a database does not exist, it will be created. - ReinRaus
  • Wouldn't the app create it every time? Or created only when compiling the program? - Radik Kamalov

1 answer 1

In OpenDatabase you specify the name of the database, if such a database does not exist, it will be created.
The database is created only once, then it can only be updated.
For updating databases, the following functions are created:

db.changeVersion("", "1.0", function(bd){ bd.executeSql('CREATE TABLE test (id, name)'); }); // это при создании базы данных db.changeVersion("1.0", "1.1", function(bd){ bd.executeSql('CREATE TABLE test2 (id2, name2)'); }); // это обновление версии 1.0 до 1.1 

If you want to learn more about this topic, read about WebSQL- PhoneGap just provides a wrapper for this HTML5 technology.

  • Question. Can I store audio files in SqLite? If not, where to store different file types? - Radik Kamalov