Nathan Morin
Posts: 0
Joined: Thu Sep 05, 2013 6:12 am

How do I increase the number of rows in a Sqlite Local Database?

Hi.

I have successfully implemented this tutorial to fit my requirements: http://devcenter.appery.io/tutorials/...

I have it working perfectly with a small dataset.

However, I am now working with a larger database (over 200 entries) and the code below is only pulling the first 100 rows. How can I increase the number of rows so that the entire database is downloaded when the javascript service is invoked?

var db = window.openDatabase("Stores", "", "Stores", 3024*3000);

db.transaction(function (tx) {
tx.executeSql('CREATE TABLE IF NOT EXISTS "Stores"(_objectId TEXT, Company TEXT, StoreName TEXT, StoreNumber TEXT, Address TEXT, City TEXT, State TEXT, ZipCode TEXT, PhoneNumber TEXT, Website TEXT, Hours TEXT, StoreManager TEXT, DairyManager TEXT, GeoCodey TEXT, Merchandiser TEXT, _createdAt DATETIME, updatedAt DATETIME)', []);
tx.executeSql('SELECT * FROM "Stores" WHERE "objectId" = "' + value._id + '"', [], function(tx, results){
console.log('rows :' + results.rows.length);

Code: Select all

     //if (results.rows.length === 0){       

     if (results.rows.length === 0){    
         console.log('Go and add table ' + value.number);     
         tx.executeSql('INSERT INTO "Stores" (_objectId, Company, StoreName, StoreNumber, Address, City, State, ZipCode, PhoneNumber, Website, Hours, StoreManager, DairyManager, GeoCodey, Merchandiser, _createdAt, _updatedAt) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', [value._id, value.Company, value.StoreName, value.StoreNumber, value.Address, value.City, value.State, value.ZipCode, value.PhoneNumber, value.Website, value.Hours, value.StoreManager, value.DairyManager, value.GeoCodey, value.Merchandiser, value._createdAt, value._updatedAt]);         
     } 
 });         

});

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

How do I increase the number of rows in a Sqlite Local Database?

Hi Nathan,

This is not sqlight DB issue.

The problem that's you have faced is automatic limit in "list" service that's 100 by default.

So you need:

1 Open your "list" service.

2 Navigate to "request" tab.

3 Add "limit" parameter. See details: http://prntscr.com/4aaco3/direct

4 Set default value for this parameter with "1000" value http://prntscr.com/4aadez/direct

See details about "limit" parameter here: http://devcenter.appery.io/documentat...

Also if you will have any problem with this implementation please follow this tutorial: http://devcenter.appery.io/tutorials/...

Regards.

Nathan Morin
Posts: 0
Joined: Thu Sep 05, 2013 6:12 am

How do I increase the number of rows in a Sqlite Local Database?

Yurii Thanks for the help!

Return to “Issues”