Take the 2008 Git User's Survey and help out! [ hide ]

public
Description: This JavaScript project provides an ActiveRecord-esque API for the Google Gears SQLite database.
Homepage: http://code.google.com/p/mechanizations/
Clone URL: git://github.com/drnic/google-gears-mechanizations.git
Search Repo:
drnic (author)
Tue May 06 22:57:54 -0700 2008
commit  4e580418f32cf0f659e28a3f397b1af273abc77e
tree    f859ec5a6a43aada58af4236e46fc0da23b6c05b
parent  ee80ced5d1ff4ce3d28dcc8fac48872258c55962
name age message
folder .gitignore Tue May 06 22:43:15 -0700 2008 updated README [drnic]
folder History.txt Tue May 06 22:43:15 -0700 2008 updated README [drnic]
folder License.txt Tue May 06 22:33:35 -0700 2008 newjsified project; converted all tests to jsun... [drnic]
folder README.markdown Tue May 06 22:57:54 -0700 2008 added CRUD example to docco [drnic]
folder Rakefile Tue May 06 22:43:15 -0700 2008 updated README [drnic]
folder config/ Tue May 06 22:33:35 -0700 2008 newjsified project; converted all tests to jsun... [drnic]
folder lib/ Tue May 06 22:33:35 -0700 2008 newjsified project; converted all tests to jsun... [drnic]
folder script/ Tue May 06 22:33:35 -0700 2008 newjsified project; converted all tests to jsun... [drnic]
folder src/ Tue May 06 22:43:15 -0700 2008 updated README [drnic]
folder tasks/ Tue May 06 22:33:35 -0700 2008 newjsified project; converted all tests to jsun... [drnic]
folder test/ Tue May 06 22:33:35 -0700 2008 newjsified project; converted all tests to jsun... [drnic]
README.markdown

Google Gears Mechanizations

This JavaScript project provides an ActiveRecord-esque API for the Google Gears SQLite database.

Usage

To manage database schema migrations:

var migrations = [
  { // version 0
    up: function(c) {
      c.createTable('people', {id: 'INTEGER', name: 'TEXT'});
    },
    down: function(c) {
      c.dropTable('people');
    }
  },
  { // version 1
    up: function(c) {
      c.createTable('addresses', {id: 'INTEGER', person_id: 'INTEGER', address: 'TEXT});
    },
    down: function(c) {
      c.dropTable('addresses');
    }
  }
];
connector = new GearsConnector('test');
connector.migrate(migrations, 1);

To perform CRUD:

connector.insert('people', [1, 'Dr Nic']);
connector.insert('people', [2, 'Ravi Chodavarapu']);
var person = connector.select('people', {where: ['id=?', 1]});

More information

Maintainer

Dr Nic Williams, http://drnicwilliams.com, drnicwilliams@gmail.com

Original author

Ravi Chodavarapu, http://ravichodavarapu.blogspot.com