Sweetch 0.0.1-alpha has been released. It’s an “alpha preview” release to allow people to play with the project. You’ll find sample code below.
/* Always use addOnLoad since it’s the only way to be sure * that all sweetch features are available. */ dojox.sql.addOnLoad(function() { // dojox.sql uses SQLite syntax dojox.sql(’CREATE TABLE IF NOT EXISTS myTable(id INTEGER PRIMARY KEY AUTOINCREMENT, label TEXT)’); var rows = dojox.sql(’SELECT id, label FROM myTable’); var r; while( r = rows.next() ) { console.info(r.id + ‘: ‘ + r.label); } var results = dojox.sql(’INSERT INTO myTable(label) VALUES(’Give me one more line ‘ + new Date())); console.info(’New record id ‘ + dojox.sql.lastInsertId()); });
A demo of Sweetch is available here. Supported providers are AIR (AIR package should be available soon), Java and Gears. It should run on several browsers (IE, Firefox, Safari, Opera, …). Give us your feedback!
Add data, switch to offline browsing, add or delete data, close your browser, reopen it, reopen the page, enjoy…
This blog will keep you aware of all Sweetch news…