Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/drnic/google-gears-mechanizations
This JavaScript project provides an ActiveRecord-esque API for the Google Gears SQLite database.
https://github.com/drnic/google-gears-mechanizations
Last synced: 29 days ago
JSON representation
This JavaScript project provides an ActiveRecord-esque API for the Google Gears SQLite database.
- Host: GitHub
- URL: https://github.com/drnic/google-gears-mechanizations
- Owner: drnic
- License: mit
- Created: 2008-05-07T05:37:33.000Z (over 16 years ago)
- Default Branch: master
- Last Pushed: 2008-05-07T05:58:10.000Z (over 16 years ago)
- Last Synced: 2023-04-10T17:09:49.322Z (over 1 year ago)
- Language: JavaScript
- Homepage: http://code.google.com/p/mechanizations/
- Size: 144 KB
- Stars: 11
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
- Changelog: History.txt
- License: License.txt
Awesome Lists containing this project
README
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
================* [Original SVN site](http://code.google.com/p/mechanizations/)
* [Original blog entry by Ravi](http://ravichodavarapu.blogspot.com/2007/07/mechanizations-towards-activerecord-for.html)Maintainer
==========Dr Nic Williams, http://drnicwilliams.com, [email protected]
Original author
===============Ravi Chodavarapu, http://ravichodavarapu.blogspot.com