Class: iPhone Development For Web Programmers March 24-25, Raleigh/Durham

ActiveRecord.js: Object Relational Mapping (ORM) for your iPhone Webapps

by Peter Cooper on January 19, 2009 · 1 comment

active_record.png

ActiveRecord.js is an open source object relational mapper (ORM) for JavaScript that takes a lot of inspiration from Ruby on Rails’ ActiveRecord database access library. In theory, objects are used to encapsulate database access and add domain logic. In practice, you can do things like this:

var fred = User.create({username: 'fred',age: 32});

fred.username // => 'fred'

fred = User.findByUsername('fred') // => returns the fred object

var users = User.find({ all: true, order: 'id DESC', limit: 10 });

ActiveRecord.js supports a lot of the functionality that you get with Rails’ own ActiveRecord and, as such, brings a lot of power directly into the browser. It supports several environments, such as Google Gears, Chrome, and Adobe AIR, but also browsers that support the HTML5 SQL specification - which includes Webkit and the iPhone’s version of Safari!

For more information, see the official ActiveRecord.js or Aptana’s announcement post (with more links and explanatory text).

{ 1 trackback }

links for 2009-01-20 | Shinji Kuwayama
01.20.09 at 1:26 pm

{ 0 comments… add one now }

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Older post: From ActionScript to Cocoa / Objective C

Newer post: Interview with Matt Gallagher on Programatic UI Testing