You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support for Firebird SQL is currently lacking, primarily because of the auto_increment of all ID fields on the models. Firebird has no such thing as autoincrement fields, thus when inserting it fails with an error:
- SQLCODE: -625
- validation error for column ID, value "*** null ***"
The solution is to explicitly define a sequence for each model which has a primary key, such as:
id = Column(Integer, Sequence('user_aid_seq', optional=True), primary_key=True)
The Sequence object also implements special functionality to accommodate Postgresql’s SERIAL datatype. The SERIAL type in PG automatically generates a sequence that is used implicitly during inserts. This means that if a Table object defines a Sequence on its primary key column so that it works with Oracle and Firebird, the Sequence would get in the way of the “implicit” sequence that PG would normally use. For this use case, add the flag optional=True to the Sequence object - this indicates that the Sequence should only be used if the database provides no other option for generating primary key identifiers.
The text was updated successfully, but these errors were encountered:
Support for Firebird SQL is currently lacking, primarily because of the
auto_increment
of all ID fields on the models. Firebird has no such thing as autoincrement fields, thus when inserting it fails with an error:The solution is to explicitly define a sequence for each model which has a primary key, such as:
As seen here and there:
The text was updated successfully, but these errors were encountered: