-
Notifications
You must be signed in to change notification settings - Fork 656
IndexedDB
agershun edited this page Dec 14, 2014
·
8 revisions
Sample (try it in jsFiddel):
var cityData = [{city:"Redmond", population:57530},
{city:"Atlanta",population:447841},
{city:"San Fracisco", population:837442}];
// Create IndexdDB database and fill it with data from array
alasql('CREATE INDEXEDDB DATABASE IF NOT EXISTS geo;\
ATTACH INDEXEDDB DATABASE geo; \
USE geo; \
DROP TABLE IF EXISTS cities; \
CREATE TABLE cities; \
SELECT * INTO cities FROM ?', [cityData], function(){
// Select data from IndexedDB
alasql('SELECT COLUMN * FROM cities WHERE population > 100000 ORDER BY city DESC',
[],function(res){
document.write('Big cities: ', res.join(','));
});
});
© 2014-2024, Andrey Gershun & Mathias Rangel Wulff
Please help improve the documentation by opening a PR on the wiki repo