[ANN] DrySQL

B

Bryan Evans

If any of you use ActiveRecord for Object-Relational Mapping in your
Ruby apps, you may find the DrySQL plug-in helpful:
http://drysql.rubyforge.org

DrySQL is a plug-in that extends ActiveRecord to provide a complete DRY
solution for Object-Relational Mapping.

You've defined columns, constraints, relationships, and keys on your DB.
With DrySQL you don't need to re-define _any_ of these things in your
Ruby
code.

DrySQL has received numerous comparisons to Magic Models as both
projects have a feature in common: automatic generation of associations
and validations for data objects. The main thing that differentiates
DrySQL is that the ORM is truly DRY. Your table names, columns names,
primary & foreign key names do not need to follow any naming
conventions, because DrySQL retrieves _all_ of this information from
your DB's information schema. By using the information schema to its
full potential, you don't need to re-define _any_ artifact of your DB
schema in your application code.

In the worst-case scenario (your table name does not conform to
ActiveRecord naming conventions), your data class could look like this:

class Employee < ActiveRecord::Base
set_table_name "EMPLOY01"
end

You never need to explicitly identify primary/foreign keys, or specify
associations or validations in your application code (if your table name
conforms to AR naming conventions, you don't even need to define a class
for it). The end result is that you don't need ORM code in your
application and you gain loose coupling to your database structure: you
can change your tables/columns/constraints on your DB and not need to
change your application code.

In addition to taking a different approach to solving the
"auto-generation of associations and validations" problem, DrySQL
introduces a number of "new" features as well.

I'm not going to try to sell you on DrySQL if you're happy with your
current Ruby ORM solution, but if your current solution doesn't meet
your needs then please do check out DrySQL:

http://drysql.rubyforge.org

Cheers.
...And sorry for the long-winded post. Hopefully some of you find it
useful

- Bryan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top