Cool. (example and it's NAME. also domain) I'll post it with my mother Language =)
2009/1/20 浩翔 <[email protected]> > > cool! > > On Jan 16, 4:38 am, khakman <[email protected]> wrote: > > Ryan Johnson and Aptana have released a solid beta of ActiveRecord.js, > > an ORM JavaScript library that implements ActiveRecord pattern and > > supporting multiple JavaScript environments including, Google Gears, > > In Memory (if no SQL server is available on the client), and Adobe AIR > > (client-side persistence). It also works on the server-side with > > SQLite and MySQL databases (via Aptana Jaxer, the open source Ajax > > server that embeds the Mozilla browser engine). HTML5 support is on > > the roadmap. > > > > http://activerecordjs.org. has the source and docs and some examples. > > ActiveRecord.js is a single file that has no other library > > dependencies. > > > > When using Gears, this means you can persist JavaScript objects and > > their data using pure JavaScript syntax and the ease of the > > ActiveRecord pattern. All the underlying SQL commands you'd otherwise > > use through the Gears API are encapsulated by ActiveRecord APIs that > > are more natural feeling to JavaScript's syntax and object concepts -- > > and often take far fewer lines of code to implement. Plus, the skills > > you develop using ActiveRecord.js can be leveraged across the other > > supported JavaScript runtimes as well. > > > > Here's a quick example adapted from Ryan's blog post [ > http://www.aptana.com/blog/rjohnson/activerecord_js_released_as_beta > > ]: > > > > - - - - - - - - - - - - > > > > ActiveRecord.connect(ActiveRecord.Adapters.Local,'my_database'); > > //Automatically Connects to Gears if Gears is present. > > > > var User = ActiveRecord.define('users',{ > > username: '', > > email: '' > > }); > > User.hasMany('articles'); > > > > var ryan = User.create({ > > username: 'ryan', > > email: '[email protected]' > > }); > > > > var Article = ActiveRecord.define('articles',{ > > name: '', > > body: '', > > user_id: 0 > > }); > > Article.belongsTo('user'); > > > > var a = Article.create({ > > name: 'Announcing ActiveRecord.js', > > user_id: ryan.id > > }); > > a.set('name','Announcing ActiveRecord.js!!!'); > > a.save(); > > > > a.getUser() == ryan; > > ryan.getArticleList()[0] == a; > > > > - - - - - - - - - - - - > > > > The Google Group for ActiveRecord.js athttp:// > groups.google.com/group/activejs/ > -- 하대환 010-2042-7565 Love Gentoo, Vim, Rails, JavaScript, Gears, OpenSocial Blog #1: http://www.myfaceroom.com/
