For instance, the connect() function of the pgdb module could take an additional parameter "datetypes" which could be set to None = "str", "datetime" or "mx" = "mx.datetime".

Need to comment myself again. I noticed that the mx.ODBC module does it similarly. They use a connection attribut "datetimeformat" that you can set to the following values:

    DATETIME_DATETIMEFORMAT [default] -> mx.DateTime
    TIMEVALUE_DATETIMEFORMAT -> Ticks
    TUPLE_DATETIMEFORMAT -> Python
    STRING_DATETIMEFORMAT -> Raw from the database (string)

I think we should use the same attribute and values, instead of inventing anything new. We only need to split DATETIME_DATETIMEFORMAT into two subvariants:

     MX_DATETIMEFORMAT [default] -> use mx.DateTime module
     DATETIME_DATETIMEFORMAT -> use Python datetime module

If mx.DateTime is not installed, then DATETIME_DATETIMEFORMAT should be the default instead. Or should we better make STRING_DATETIMEFORMAT the default for backward compatibility?

-- Christoph
_______________________________________________
PyGreSQL mailing list
[email protected]
http://mailman.vex.net/mailman/listinfo/pygresql

Reply via email to