I’ve just released Lafcadio, an object-relational mapping layer for
Ruby and MySQL, as an alpha release. So far this code hasn’t been used
by anybody else, but it’s currently in use on three live sites –
including one pretty high-traffic site – not to mention that I’ve
used it over the past year on a number of personal projects.
Again, it’s in alpha, so I don’t expect anybody to put their payroll
system on it right now. But if there’s anybody out there who’s
interested in this sort of thing, and would like to help me out with
it – either just testing it or coding or just telling me where my
docs could be clearer – I’d appreciate your input.
I have noticed this, and Vapor (for PostgreSQL) being advertised. Is
there difficulty in building against the DBI module to allow some
degree of database independence?
-Brian
···
On Sunday, August 3, 2003, at 08:45 AM, Francis Hwang wrote:
Hi everybody,
I’ve just released Lafcadio, an object-relational mapping layer for
Ruby and MySQL, as an alpha release. So far this code hasn’t been used
by anybody else, but it’s currently in use on three live sites –
including one pretty high-traffic site – not to mention that I’ve
used it over the past year on a number of personal projects.
Again, it’s in alpha, so I don’t expect anybody to put their payroll
system on it right now. But if there’s anybody out there who’s
interested in this sort of thing, and would like to help me out with
it – either just testing it or coding or just telling me where my
docs could be clearer – I’d appreciate your input.
I’ve just released Lafcadio, an object-relational mapping layer for
Ruby and MySQL, as an alpha release. So far this code hasn’t been used
by anybody else, but it’s currently in use on three live sites –
including one pretty high-traffic site – not to mention that I’ve
used it over the past year on a number of personal projects.
This looks interesting, but IMO it would be far more useful if you would
use DBI instead of direct mysql access.
ATM i’m making project that will help one to quickly have site with news
system, forum, guestbook, etc. May i include your code into the package?
I want to use it widely through all of my code. It will be released as LGPL.
P.S. I’m now trying to make test-suites run without errors on 1.8, it have a
lot of “meth (bla)” code, that sometimes raises syntax errors.
Database independence, to my mind, is a useful goal but not the main
point of an object-relational mapping layer. For me, the main point is
reducing the need to keep small database-details in mind, and treat
domain entities like they’re first-class Ruby objects, with as little
thinking about the underlying DB as possible.
Example 1: You have a Invoice class (or table) with an invoiceDate
field. Lafcadio code to manipulate this date might look like:
… so you don’t have to think about SQL date formatting. Similarly,
string fields don’t have to be quote-escaped for commits.
Example 2: Your Invoice table has two boolean fields: “shipped” stores
values in MySQL as 0 and 1, while “viewed” stores values as “Y” and
"N". This is far from ideal, of course, but unfortunately I’ve seen
far worse code in my career. And let’s say you can’t change these
fields easily because they’re accessed in an indeterminate number of
PHP scripts. (Also common, unfortunately.) Committing straight through
DBI would require you to always remember which field uses which
enumeration, but by setting your field definitions in Lafcadio code
you’d never have to think about it again. You could simply set them to
be true or false:
I have noticed this, and Vapor (for PostgreSQL) being advertised. Is
there difficulty in building against the DBI module to allow some
degree of database independence?
-Brian
On Sunday, August 3, 2003, at 08:45 AM, Francis Hwang wrote:
Hi everybody,
I’ve just released Lafcadio, an object-relational mapping layer for
Ruby and MySQL, as an alpha release. So far this code hasn’t been used
by anybody else, but it’s currently in use on three live sites –
including one pretty high-traffic site – not to mention that I’ve
used it over the past year on a number of personal projects.
Again, it’s in alpha, so I don’t expect anybody to put their payroll
system on it right now. But if there’s anybody out there who’s
interested in this sort of thing, and would like to help me out with
it – either just testing it or coding or just telling me where my
docs could be clearer – I’d appreciate your input.
If this is to become reusable across a number of different DBs (like
PostgresSQL) then I suppose that’s a necessary step. That step should
be fairly easy, since the database calls are limited to just a few
methods.
The main difficulty in such an adaptation would be differences in SQL;
without having used PostgresSQL a lot I’d imagine there would be a few
key differences that would require adaptation.
Or is there another reason you’re bringing up DBI?
I’ve just released Lafcadio, an object-relational mapping layer for
Ruby and MySQL, as an alpha release. So far this code hasn’t been used
by anybody else, but it’s currently in use on three live sites –
including one pretty high-traffic site – not to mention that I’ve
used it over the past year on a number of personal projects.
This looks interesting, but IMO it would be far more useful if you would
use DBI instead of direct mysql access.
ATM i’m making project that will help one to quickly have site with news
system, forum, guestbook, etc. May i include your code into the package?
I want to use it widely through all of my code. It will be released as LGPL.
Perhaps things would be clearer for people using your package if you
simply listed Lafcadio as a requirement, and pointed them to where it
can be downloaded. Being in alpha, Lafcadio might be a bit of a moving
target in the short term, so it might be a bit of a hassle for you to
constantly incorporate new changes.
P.S. I’m now trying to make test-suites run without errors on 1.8, it have a
lot of “meth (bla)” code, that sometimes raises syntax errors.
Oop! Been doing a lot more testing in 1.6.8 than in 1.8. I’ll get on
that right away, thanks.
Database independence, to my mind, is a useful goal but not the main
point of an object-relational mapping layer. For me, the main point is
reducing the need to keep small database-details in mind, and treat …
Moreove, we have found that DBI causes quite lot of overhead, which
might be very important for a live site. We have been using a
home-grown persistent layer as a part of our application server (not
yet released…) which was based on DBI. The success of some of the
sites (www.focusmag.gr) based on the application server, lead us to
try and optimize anything we could. We noticed dramatic increase in
db-specific parts of our code by removing DBI and directly accessing
MySQL with ruby-mysql. One major problem seemed to be the conversion
of results to Row instances…
ATM i’m making project that will help one to quickly have site with news
system, forum, guestbook, etc. May i include your code into the package?
I want to use it widely through all of my code. It will be released as
LGPL.
Perhaps things would be clearer for people using your package if you
simply listed Lafcadio as a requirement, and pointed them to where it
can be downloaded. Being in alpha, Lafcadio might be a bit of a moving
target in the short term, so it might be a bit of a hassle for you to
constantly incorporate new changes.
I placed it in the redist directory, and probably, i’ll write it in my INSTALL
file, that user will be able to use another version of lafcadio. I just want
to have as little dependencies, as it is possible, to make everything working
out of box. But maybe i’m wrong, i have to think about this some time.
P.S. I’m now trying to make test-suites run without errors on 1.8, it
have a lot of “meth (bla)” code, that sometimes raises syntax errors.
Oop! Been doing a lot more testing in 1.6.8 than in 1.8. I’ll get on
that right away, thanks.
No problems, if you want i could mail you (or give you data for accessing CVS)
that have a lots of code fixed already.
Btw, big thank you for a good library!
···
On Tuesday 05 August 2003 10:18, Francis Hwang wrote:
Perhaps things would be clearer for people using your package if you
simply listed Lafcadio as a requirement, and pointed them to where it
can be downloaded. Being in alpha, Lafcadio might be a bit of a moving
target in the short term, so it might be a bit of a hassle for you to
constantly incorporate new changes.
I placed it in the redist directory, and probably, i’ll write it in my INSTALL
file, that user will be able to use another version of lafcadio. I just want
to have as little dependencies, as it is possible, to make everything working
out of box. But maybe i’m wrong, i have to think about this some time.
That might work, too. Feel free to try out whatever you think will
work for your project. BTW, Lafcadio is LGPL, too.
P.S. I’m now trying to make test-suites run without errors on 1.8, it
have a lot of “meth (bla)” code, that sometimes raises syntax errors.
Oop! Been doing a lot more testing in 1.6.8 than in 1.8. I’ll get on
that right away, thanks.
No problems, if you want i could mail you (or give you data for accessing CVS)
that have a lots of code fixed already.
I went ahead and fixed all the syntax errors (mostly adding a lot of
parenthesis) and all the tests run fine as of the last CVS checkin,
but you have to suppress warnings or else the output’s pretty messy.
I’m planning on fixing all the warnings in the next day or so.
If you want to email me code that fixes warnings, that’d be great.
Otherwise I can just handle it on my own, too.
Btw, big thank you for a good library!
You’re welcome!
···
On Tuesday 05 August 2003 10:18, Francis Hwang wrote:
Today’s release (0.1.2) runs fine in Ruby 1.8.0 without any warnings.
Thanx, sorry for being idle for a while…
Question, do you make changes to CVS often? Or i can just get the tar-ball?
···
On Thursday 07 August 2003 23:05, Francis Hwang wrote:
On Thursday 07 August 2003 23:05, Francis Hwang wrote:
Today’s release (0.1.2) runs fine in Ruby 1.8.0 without any warnings.
Thanx, sorry for being idle for a while…
Question, do you make changes to CVS often? Or i can just get the tar-ball?
Francis
At this moment I’m not making a lot of drastic changes, so you can
probably just get the tar-ball.