-
Notifications
You must be signed in to change notification settings - Fork 714
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
Open Existing SQLite DB file (pre-population) #172
Comments
This is pre-population, which others have been asking for. See #10 for old discussions. |
There are some old forks that have implemented pre-population. Solutions have been given over the net, and also on the forum. I am now considering integrating (Android and iOS only), under an optional parameter. |
I have now pushed a new release to master with optional support for pre-populated database. Please see README.md for details. |
If you still interested please look at this solution: |
I am trying to open an existing sqllite database. I can't seem to get it to open.
I have copied the db file to the platforms/android/assets directory. I don't get any errors in the output.
I am using ionic framework
here is my code
var db =null;
function onDeviceReady() {
db = sqlitePlugin.openDatabase({name: "testdb"});
db.transaction(function(tx) {
tx.executeSql("SELECT * FROM people limit 20;",[], function() {
var testTable = new htTable();
testTable.setHeader(['name', 'address', 'phone']);
for( var i = 0; i < r.rows.length; i++ ) {
var row = r.rows.item(i);
testTable.addRow([row.city, row.state, row.zipcode]);
}
element('data').innerHTML = testTable.getTableHTML();
The text was updated successfully, but these errors were encountered: