Re: Re: [Rails] ActiveRecord: It's not only quoting

contact at maik-schmidt.de contact at maik-schmidt.de
Fri Dec 17 09:02:01 GMT 2004


Curt Sampson <cjs at cynic.net> schrieb am 17.12.2004, 09:42:12:
> > > I think it's not a good idea to clutter the code base with esoteric
> > > DB2/Oracle/... knowledge. Any suggestions?
> 
> I think the adapater will just have to know how to DTRT if this is
> essential. Fortunately, it doesn't seem difficult, though it could mean
> executing a couple of extra queries on some DBMSes.
> 
> But is this just needed for user stuff, or is it used elsewhere? A good
> relational design shouldn't really need to use stuff like LIMIT.
It's used in ActiveRecord::Base (find_all, find_first). I think that
it's not needed in find_first, because it calls select_one, but
find_all seems to need it.

Of course, the adapter could offer a brute force solution, i.e. fetch
all rows until the limit is reached, but this could unnecessarily slow
down some database servers.

Maik


More information about the Rails mailing list