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.1 → 0.1, exact |
DOUBLE PRECISION |
Float(53) |
FLOAT(53) |
— |
0.1 → 0.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.
Versions
firebirdsql/firebird:5,LI-V5.0.4.1812 Firebird 5.0, engine version5.0.4fromRDB$GET_CONTEXT('SYSTEM','ENGINE_VERSION')What happens
Core's
Doubleis rendered as a bareDOUBLE, which isn't a keyword Firebird has. The parser is waiting forPRECISION, so it fails on whatever comes next and no table is created: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.pylineage rather than either fork:DoubleDOUBLEDOUBLEDOUBLE_PRECISIONDOUBLE PRECISION0.1→0.1, exactDOUBLE PRECISIONFloat(53)FLOAT(53)0.1→0.1, exactDOUBLE PRECISIONWorth 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
DoubleasDOUBLE PRECISION.visit_DOUBLEcurrently emits the type name verbatim; Firebird needs the two-word spelling.Workaround for anyone who lands here in the meantime: use
DOUBLE_PRECISIONfrom the dialect rather than Core'sDouble.Float(53)also works and ends up in the same column, butDOUBLE_PRECISIONsays what it means.