Offers a Mootools way to interface with html5 databases (also known as "persistent storage"). Tries to use google gears if no html 5 database is found. It requires Mootools and is tested with v1.2.4.
var db = new Database('Mootools_Database_Demo'); db.execute('SELECT name FROM demo WHERE id = ?;', { values: [123], onComplete: function(resultSet){ while(row = resultSet.next()){ alert(row.get('name')); // You can get columns by key alert(row.get(0)); // or by index } }, onError: function(error){ alert('Oops: ' + error.message); } }); /* * To make it easier for you to update your app without * breaking compatibility with earlier versions of your * databases, the Database wrapper supports versioning. */ if(db.getVersion() == '1.0') { db.execute('ALTER TABLE demo RENAME TO production'); db.changeVersion('1.0', '2.0'); }
You can see a simple demo in this shell.
HTML 5 Databases
Google Gears Databases
See license file.
A note on comments here: These comments are moderated. No comments will show up until they are approved. Comments that are not productive (i.e. inflammatory, rude, etc) will not be approved.
Found a bug in this plugin? Please report it this repository's Github Issues.
blog comments powered by Disqus