[ANN] Lafcadio 0.4.0

F

Francis Hwang

I've just released Lafcadio 0.4.0, which is the new production
release.

http://lafcadio.rubyforge.org/

If you don't know what Lafcadio is, it's an object-relational mapping
library for MySQL and Ruby. Its features include:

* A test-centric design that allows you extensively unit test any
program that runs on top of Lafcadio. It comes with a MockObjectStore,
which mimics the database and allows you to test database interactions
without all the annoying setup code of a real database-driven test.
* A block-driven querying language that will cover 99% of the ad-hoc
queries you have to do. These queries look like:

child_users = object_store.getUsers { |user| user.age.lt( 18 ) }

These queries can be run against the MockObjectStore, meaning they can
be unit-tested.
* In-Ruby triggers that can be written per domain class. These
triggers can be tested, too!
* Lafcadio makes very few assumptions of how your database was setup,
and comes complete with a lot of hooks to allow you to fit your
pre-existing database. Because programming's a messy job, and we're
always cleaning up after somebody's mistakes (even if they were our
own).

Lafcadio is production-ready and runs a number of websites, including
Rhizome.org, which more than 3 million hits a month.

0.4.0 contains a number of new features over the previous stable
releases:

* Optimizations which cache retrievals intelligently, and do lazy
evaluation of individual fields for cases in which you load rows that
have many fields but you only care about a few.
* A new syntax for ad-hoc querying which gives you a lot of expressive
power with much less typing than before.
* A lot less unnecessary code, and a lot more documentation for the
code that remains.
* The option to define domain class fields in an external XML file.
* Lafcadio now uses DBI instead of Ruby/MySQL.
* Lafcadio uses log4r for SQL logging.

There are a lot of small changes, and a number of warnings for those
migrating forward from Lafcadio 0.2.x. Please read the changelog for
full details.

Francis
 
G

gabriele renzi

il 27 Jun 2004 16:31:26 -0700, (e-mail address removed) (Francis Hwang) ha
scritto::
I've just released Lafcadio 0.4.0, which is the new production
release.

nice to hear that lafcadio is still in active development.
Just a thing, I forgot if you talked about it in the past.
Why:
user.age.lt( 18 )
instaed of
user.age <= 18
?
is it for some consistency reason
(i.e. unable to overrride && and ||) ?

PS
you should add websites using lafcadio to the RealWorldRuby page :)
 
K

Kaspar Schiess

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

| nice to hear that lafcadio is still in active development.
| Just a thing, I forgot if you talked about it in the past.
| Why:
| user.age.lt( 18 )
| instaed of
| user.age <= 18
| ?
| is it for some consistency reason
| (i.e. unable to overrride && and ||) ?

[If I take the liberty of answering that question, Francis may want to
correct me...]
Yes, last time that was discussed the arguments against overloading of
Ruby operators was a semantic one: Different precedences of operators in
SQL and Ruby cause behaviour that will be difficult to explain.

Francis: Nice work ! Looks like all of my whishlist has actually made it
into the new release ! And I like the query language, will have a look
at it in a few weeks. Thank you for developing this great library.

kaspar

semantics & semiotics
code manufacture

www.tua.ch/ruby
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFA3/6CFifl4CA0ImQRAhJ5AJ9oMUbzjjhtxm9fK4ASVdE2HS4QZwCfZP/y
3tfgilYg910EIGZx0JBPpuY=
=hMpv
-----END PGP SIGNATURE-----
 
F

Francis Hwang

gabriele renzi said:
Just a thing, I forgot if you talked about it in the past.
Why:
user.age.lt( 18 )
instaed of
user.age <= 18
?
is it for some consistency reason
(i.e. unable to overrride && and ||) ?

Most of my reasons are here:
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&c2coff=1&safe=off&th=bd95be9531dd8783&rnum=2

Basically, I'm reluctant to use a syntax that looks almost exactly
like Ruby but is subtly different, which could increase the chance of
gotchas. For one thing, you can't override unary negation in Ruby, but
if you were to try it it might fail silently.

Note, however, that due to how this was all designed in Lafcadio, the
query inference syntax is pretty much orthogonal to the underlying
query representation. Meaning that although there's only one query
inference engine in Lafcadio right now, and wouldn't be too hard for
somebody to write a different, more Criteria-style query inference
engine, which could be swappable by configuration or even at runtime.

Francis
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top