As Charles pointed out, the string-fumbling should merely be a fallback path.

Michael

On Fri, 4 Feb 2005 04:11:02 +0900, Michael Neumann <mneumann / ntecs.de> wrote:
> Charles Mills wrote:
> > Michael Neumann wrote:
> > (...)
> >
> >>Well, I think Ruby/DBI is not the fastest. It parses (and splits)
> >
> > each
> >
> >>SQL statement, then joins it back into a string, even if you don't
> >
> > use
> >
> >>'?' parameter markers. This should be delayed and omitted if no
> >>parameters were given. Not sure whether this is the reason for the
> >
> > slowness.
> >
> >
> > This may be a dumb question, but why does ruby/dbi do that?  For
> > databases that don't support precompiled statements and binding
> > parameters?
> 
> Yeah, good question. It tries to abstract over the database. Well,
> sometimes it's nicer to write:
> 
>    dbh.execute("INSERT INTO tab values (?, ?, ?)", a, b, c)
> 
> instead of:
> 
>    dbh.execute("INSERT INTO tab values (#{ quote(a) }, #{ quote(b) }, #{
> quote(c) })")
> 
> Regards,
> 
>    Michael
> 
>