Sync Progress and Contact Management with Gears
Written by on August 9th, 2007 in Ajax News.
A couple of Gears samples have been released.
Arjun Kalura has created a
database sync module that shows the progress of a sync between a remote database, and a local one. The example also uses the worker pool to execute SQL in its own thread and hence keeping the user interface freed up to show the progress report on how the sync process is going.
Steve Yen of TrimPath has created a bare bones contact sample that shows you how to use the Junction framework (which is Rails-esque in JavaScript).
You can handle migrations via:
-
-
TrimPath.junctionDbMigrate = {
-
-
‘/db/migrate/0001_contact.js’ : { up: function() {
-
createStandardTable(’Contact’,
-
column(’first_name’, ’varchar(100)’),
-
column(’last_name’, ‘varchar(100)’),
-
column(’address’, ‘varchar(300)’),
-
column(’phone’, ‘varchar(100)’)
-
);
-
},
-
down: function() {
-
dropTable(’Contact’);
-
}
-
},
-
done: null
-
}
-
Validate your model:
-
-
with (modelFor(’Contact’)) {
-
validatesPresenceOf(’first_name’);
-
validatesPresenceOf(’last_name’);
-
}
-
and much more.
Source: Ajaxian
Original Article: http://feeds.feedburner.com/~r/ajaxian/~3/142407647/sync-progress-and-contact-management-with-gears
