Active Record Like

Active Record Like makes other things active record like. In a project, we used it to access an existing C# api using ActiveScaffold.

It's not build for speed or large data sources. I would not advice it to access LDAP for example. It's currently simple minded. But it saves us from doing lots of work. A foreign API becomes active record like and we do usual crud.

The implementation uses pure functional programming to parse and convert SQLl caused by the active record calls.

Anything can be active record like. There is a sample project which makes memcached active record like. The result is pure in cache database (like)!

Interesting Points

  • Ruby compiler generator (TreeTop) using simple grammar definitions
  • Transformations specified in a pure Functional DSL

https://github.com/umuro/active_record_like/tree/master/lib/concept_space/active_record_like/adapter/parser is where grammar and functional transformations are defined:

  • Of course, *.treetop files are the ones in parser directory. The samenamed *.rb files are auto-generated.
  • find_order.rb and find_conditions.rb are where functional DSL is used to define grammar translations.

Source of the Working Sample

Online: http://github.com/umuro/sample_active_record_like_rails/tree/master
GIT Clone URL: git://github.com/umuro/sample_active_record_like_rails.git

Source of the Library

Online: http://github.com/umuro/active_record_like/tree/master
GIT Clone URL: git://github.com/umuro/active_record_like.git

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License