Lafcadio is an object-relational mapping library for Ruby. The point of an ORM is to allow you to treat database rows like first-class objects, minimizing the amount of time you have to spend thinking about SQL vagaries so you can spend more time thinking about your program's logic. It currently supports MySQL and PostgreSQL.
Features include:
-
Strong support for testing with a full-featured mock database and dead-simple dependency injection (via ContextualService).
-
A rich query inference language that takes full advantage of Ruby's reflective nature. You can use this to create database queries that run against both the real database and the mock database. You can also use this to build complex queries without the annoying and error-prone process of concatenating SQL strings.
-
Heavy support for legacy databases. Lafcadio's attitude towards schemas is fairly pragmatic: Although it's nice to be able to create a schema from scratch, there are a lot of legacy schemas out there that still need support. Lafcadio goes quite far in supporting those older schemas. If you've got a boolean field whose values are "y" and "n" instead of 0 and 1, Lafcadio can handle that. If you've got a field that stores an array as a comma-delimited list, Lafcadio can handle that too.
In development since 2002, Lafcadio is still in active development, but is mature enough to be used in production systems. Most notably, it's used at Rhizome.org, an online arts website that gets more than a million pageviews a month.