firedird date type reflected as datetime instead of date

Issue #1573 resolved
Former user created an issue

In firebird.py

class FBDate(sqltypes.DateTime):

should be

class FBDate(sqltypes.Date):

Comments (5)

  1. Former user Account Deleted

    Duh, i mistyped Firebird in the summary field :( Btw. i tested it on Linux with

    firebirdsql 2.1.2 sqlalchemy 0.5.6 kinterbasdb 3.3.0

  2. Lele Gaifax

    I'm somewhat surprised by this, and never noticed a bad behaviour on DATEs. There is a test that explicitly checks the case (see tests/dialect/test_firebird.py): is that failing for you? If so, could you cook up a test recipe that triggers the wrong reflection?

    Note also that the types handling changed dramatically in SA 0.6.

  3. Former user Account Deleted

    Ok, i wasn't precise enough. The introspection code is ok, and tests are ok too. I get back FBDate type for a Date field.

    The problem is that the result isinstance(mytable.c.mydatecolumn.type, sqlalchemy.types.DateTime) is True, koz FBDate class was derived from sqlalchemy.types.DateTime, instead of sqlalchemy.types.Date. I just notice it's defined correctly for other databases, f.e.: class PGDate(sqltypes.Date): or class MSDate(sqltypes.Date):

    The problem can be reproduce with formalchemy. It decides the fields output format from (auto)reflected columns types.

  4. Log in to comment