Skip to content

Fix data type case after keyword column names. - #421

Open
CRISvsGAME wants to merge 1 commit into
darold:masterfrom
CRISvsGAME:fix-keyword-column-type-case
Open

CRISvsGAME wants to merge 1 commit into
darold:masterfrom
CRISvsGAME:fix-keyword-column-type-case

Conversation

@CRISvsGAME

Copy link
Copy Markdown

Fix data type case formatting when a CREATE TABLE column name is also a known keyword.

For example:

CREATE TABLE accounts (
    password VARCHAR(255),
    type VARCHAR(255)
);

With the default lowercase type case, the data types were left unchanged because the preceding column names were still recognized as keywords during type formatting.

The fix preserves the column context while processing the following recognized data type, without weakening keyword or type detection globally. It applies generically to data types handled by pgFormatter's existing type detection rather than to any specific type such as VARCHAR.

Regression coverage includes:

  • keyword column names with VARCHAR
  • SET type suppression with DOUBLE PRECISION
  • DATE followed by a typed default as a control
  • constraint names that are also type names as a control
  • CREATE UNLOGGED TABLE
  • uppercase type-case formatting with UUID
  • an existing owner INT fixture that exposed the same issue

Validation:

  • prove -Ilib t/*.t — 96 tests passed
  • perl t/regress_test.pl — 284 fixtures passed

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.

1 participant