ActiveRecord: JavaScript ORM Library

Aptana has just released a beta version of its ActiveRecord.js which is an ORM JavaScript library that implements the ActiveRecord pattern. It works with AIR and other environments:

ActiveRecord.js is a single file, MIT licensed, relies on no external JavaScript libraries, supports automatic table creation, data validation, data synchronization, relationships between models, life cycle callbacks and can use an in memory hash table to store objects if no SQL database is available.


var User = ActiveRecord.define('users',{
    username: '',
    email: ''

var ryan = User.create({
    username: 'ryan',
    email: ''

var Article = ActiveRecord.define('articles',{
    name: '',
    body: '',
    user_id: 0

var a = Article.create({
    name: 'Announcing ActiveRecord.js',
a.set('name','Announcing ActiveRecord.js!!!');;

a.getUser() == ryan;
ryan.getArticleList()[0] == a;




Posted in:

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: