[ruby-dbi-users] Proposing patch for sqlite3 driver
kubo at jiubao.org
Wed Oct 1 20:54:10 EDT 2008
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.
2. scan the result to check the date style.
3. If the date style is "SQL" or "PostgreSQL", scan it again to check substyle
- NonEuropean or US
4. make strftime formats according to the date style and substyle and
set them to the
connection as instance variables.
5. convert Datetime, Date and Time to string by the strftime formats.
More information about the ruby-dbi-users