Skip to content

Fix hardcoded INTEGER for autoincrement primary keys (#88)#89

Open
fdcastel wants to merge 1 commit intomainfrom
fix/issue-88-autoincrement-pk-type
Open

Fix hardcoded INTEGER for autoincrement primary keys (#88)#89
fdcastel wants to merge 1 commit intomainfrom
fix/issue-88-autoincrement-pk-type

Conversation

@fdcastel
Copy link
Copy Markdown
Owner

@fdcastel fdcastel commented May 7, 2026

Summary

  • Closes hardcode database type INTEGER in primary key field #88: the DDL compiler hardcoded INTEGER for autoincrement primary keys, so BigInteger/SmallInteger primary keys were emitted as INTEGER GENERATED BY DEFAULT AS IDENTITY.
  • Reuse the dialect's type compiler to render the column's actual type, so BIGINT and SMALLINT IDENTITY columns are now emitted correctly (Firebird supports identity on SMALLINT, INTEGER, BIGINT).
  • Adds a parametrized regression test in test_compiler.py covering all three integer types.

Test plan

  • Manual repro from the issue now emits BIGINT GENERATED BY DEFAULT AS IDENTITY.
  • ruff check and ruff format --check pass on the touched files.
  • CI matrix (Firebird 3.0/4.0/5.0 x Python 3.11/3.12/3.13) green.

Use the column's compiled type instead of a hardcoded INTEGER when
emitting GENERATED BY DEFAULT AS IDENTITY, so that BigInteger and
SmallInteger primary keys produce BIGINT/SMALLINT IDENTITY columns.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hardcode database type INTEGER in primary key field

1 participant