-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
openDatabase();? How to open an existing database? #13
Comments
The string you pass to the PGSQLitePlugin constructor is a the db filename. This filename is joined with the appData directory to create a full db path. Then sqlite3_open gets called with the full db path. This function automatically creates a new db if the file does not exsists otherwise it opens the existing one. see https://github.com/davibe/Phonegap-SQLitePlugin/blob/master/Plugins/PGSQLitePlugin.m#L42 Davide Bertola On Mar 18, 2012, at 12:36 AM, Noli Sicad wrote:
|
Yes, it opens existing database. [Session started at 2012-03-21 22:10:46 +1100.] |
In WebSQL / indexDB:
var db = openDatabase('mydb', '1.0', 'Test DB', 2 * 1024 * 1024);
http://www.tutorialspoint.com/html5/html5_web_sql.htm
Now, how to we open a database (i.e. openDatabase) with the existing sqlite database (e.g. myLocation.sqlite3)
var db = openDatabase ( )
In the example Readme.
var db;
db = new PGSQLitePlugin("test_native.sqlite3");
Is the "test_native.sqlite3" would be created in the above snippet (i.e new) or can be existing database?
db.executeSql('DROP TABLE IF EXISTS test_table');
It seems also extisting (noticing the above line).
Anyway, I just like to make it sure, how to open existing databases.
The text was updated successfully, but these errors were encountered: