MooSQL 0.9

Class wrapper for HTML5 SQL Storage

More information on HTML5 SQL Storage http://dev.w3.org/html5/webdatabase/



Details

Author
Szikszai Gusztáv
Current version
0.9
GitHub
gdotdesign/moosql
Downloads
4502
Category
Utilities
Tags
Report
GitHub Issues

Releases


Dependencies

  • _self_/_current_:
    • Class
    • Class.Options
    • Class.Events

How to use

    //Create an instance.
    var sqlDB = new MooSQL({
        //Database name
        dbName:'Test',
        //Database version (max 4 numbers seperated by dots)
        dbVersion:'1.0',
        //Database description (officially database display name)
        dbDesc:'This is a test Database',
        //Estimated size
        dbSize:20*100
    })
    sqlDB.addEvent('databaseReady',function(){
        //Execute some SQL statement, callback is needed
        sqlDB.exec("SELECT * FROM 'sometable'",callback.bindWithEvent());
    })

    //Callback function
    function callback(transaction,result){
       log(result.rows.item(0));
    }

Events

databaseReady - fires when the database is ready for work.

databaseCreated - fires when the database created if there is none.

notSupported - fires if the browser not supports SQL storage

transactionError - fires if something goes wrong with the transation, 1 argument(SQLException)

statmentError - fires if the statement is invalid , 1 argument(SQLException)


Changelog

Added helper functions (find,remove,save,insert etc).

The source is now in CoffeScript.


Discuss

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