Connecting to existing sqlite databases is not officially supported by the current version; JayData needs to build database schemas to work. You can try to create a JavaScript schema that simply maps to an existing sqlite schema and see if JayData allows it to work, but this is a really complicated script.
If you let JayData manage the table for you, then
Create SQL table:
var Person = $data.define("Person", { name: String, contact: String });
Click some data:
Person.addMany([{name: 'john'}, {name:'jane', contact: '555-1234'}]);
Extract data and put in div
Person.readAll().then(function(persons) { persons.forEach(function(person) { $('#list').append(person.name); }); });
If you are interested in this approach, you can read the JayData ItemStore API in more detail .
source share