[ruby-dbi-users] Proposing patch for sqlite3 driver (very, very long)
erik at hollensbe.org
Sun Oct 5 16:14:34 EDT 2008
On Thursday 02 October 2008 19:50:46 Erik Hollensbe wrote:
> On Wednesday 01 October 2008 23:30:57 Erik Hollensbe wrote:
> > On Wednesday 01 October 2008 17:54:10 KUBO Takehiro wrote:
> > > Hi,
> > >
> > > On Wed, Oct 1, 2008 at 8:55 PM, Jarl Friis <jarl at gavia.dk> wrote:
> > > > So all-in-all I consider my proposal at least as good as the current
> > > > implementation. Yet I agree that it could be nice with an even better
> > > > solution. The low-level pg-driver accepts a DateTime, could that be
> > > > used
> > >
> > > How about the following solution?
> > > 1. execute 'SHOW DateStyle;' just after establishing a connection.
> > The problem is still a problem however, and that's due to how coarse
> > DBI's handling of inbound parameter conversion (dbh.do, sth.execute, etc)
> > is done. I knew this was a less than optimal solution, but I didn't
> > realize it would be such an impediment for issues like this. It looks
> > like DBI 0.4.1 needs to be released with a solution to this problem.
> I know I promised a prototype tonight, but being realistic I just don't
A day late and a dollar short: http://gist.github.com/14922
I think this will handle the problem.... note that from/to relates to ruby,
not the database, so "from_type" is from a ruby type, not from Pg.
The database handle mock is pretty loose, but I hope the "real world example"
at the bottom will clear things up a bit, demonstrating how these things
would happen inside DBI. I didn't think it was worth filling out a complete
mock of DBI to demonstrate this. :)
Anything (really, anything!) comment-wise would be very helpful here. I'm not
interested in just getting yelled at when this does something people don't
like, let's preempt this, please. Ideally, a clone/fork of this with your
specific comments in edits (unless they amount to a general "it sucks", which
is fine as well) would be helpful.
More information about the ruby-dbi-users