Skip to content

Core's Double renders as bare DOUBLE, which Firebird's parser rejects, so the table is never created #93

Description

@ChrisGVE

Versions

  • SQLAlchemy 2.0.51, Python 3.12.9, macOS
  • Server: firebirdsql/firebird:5, LI-V5.0.4.1812 Firebird 5.0, engine version 5.0.4 from RDB$GET_CONTEXT('SYSTEM','ENGINE_VERSION')

What happens

Core's Double is rendered as a bare DOUBLE, which isn't a keyword Firebird has. The parser is waiting for PRECISION, so it fails on whatever comes next and no table is created:

SQL error code = -104
Token unknown - line 4, column 1
)

I compiled the same metadata against both Firebird dialects to see whether it was specific to one port. It isn't — both emit the same thing, so it looks like the shared base.py lineage rather than either fork:

type asked for sqlalchemy-firebirdsql 0.1.0 sqlalchemy-firebird 2.2.0 stored / read back reflected as
Double DOUBLE DOUBLE table not created
DOUBLE_PRECISION DOUBLE PRECISION 0.10.1, exact DOUBLE PRECISION
Float(53) FLOAT(53) 0.10.1, exact DOUBLE PRECISION

Worth being clear about

This is the dialect, not Firebird. Firebird holds an 8-byte float perfectly well once it's asked in its own words — both workarounds above land in the same column and round-trip exactly. I'm recording it on my side as a client-library defect so nobody later goes looking for it in the database.

Suggested fix

Render Double as DOUBLE PRECISION. visit_DOUBLE currently emits the type name verbatim; Firebird needs the two-word spelling.

Workaround for anyone who lands here in the meantime: use DOUBLE_PRECISION from the dialect rather than Core's Double. Float(53) also works and ends up in the same column, but DOUBLE_PRECISION says what it means.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions