Skip to content
Selvam Palanimalai edited this page Aug 16, 2013 · 3 revisions

app.db module

This module is wrapper on top of datavore, a lightweight in-browser javascript database. datavore doesnt have an inbuilt event system to register listeners on the data. We use an instance of the Mediator to give datavore a publish/subscribe system. Also, datavore doesnt have in-built memory. It doesnt store/save the tables created by it in the app. This angular wrapper takes care of that too.

To start using, you need to include this module.

mod = angular.module "MyAPP" ,["app.db"] 

mod.service "test",[
    "database"
    (database)->
        #code goes here
        #database.createTable "foo"

]

API

database.create(input,tname)

database.addColumn(cname, values, type, iscolumn...,tname)

database.removeColumn(cname,tname)

database.addListener(opts)

database.destroy(tname)

database.rows(tname)

database.cols(tname)

database.get(tname,col,row)

database.exists(tname)

Query methods

database.query(tname)

database.dense_query(tname)

database.sparse_query(tname)

database.where(tname)

Clone this wiki locally