quicksql icon indicating copy to clipboard operation
quicksql copied to clipboard

“number” in column comment causes datatype to be set as NUMBER

Open neilfernandez opened this issue 2 months ago • 0 comments

Description: When defining a table in QuickSQL, the presence of the word “number” in a column comment causes the column’s datatype to change to NUMBER, even when a string type was specified.

Example:

my_table
    org_no                   vc11                    [Swedish organization number XXXXXX-XXXX.]
    vat_nr                   vc20                    [VAT number for non swedish companies.]

Generated SQL:

create table my_table (
    id        number default on null to_number(sys_guid(), 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') 
              constraint my_table_id_pk primary key,
    org_no    number,
    vat_nr    number
);

comment on column my_table.org_no is 'Swedish organization number XXXXXX-XXXX.';
comment on column my_table.vat_nr is 'VAT number for non swedish companies.';

Expected Behavior: The datatypes for org_no and vat_nr should remain VARCHAR2(11) and VARCHAR2(20) respectively, regardless of the comment text.

Actual Behavior: QuickSQL changes both columns to NUMBER due to the word “number” appearing in the comment.

Notes:

  • Reproducible in current QuickSQL parser.
  • Trigger condition: the token number in a comment is likely being misinterpreted as a type indicator.
  • May require disambiguation between comment text and type inference tokens.

Reported by: Mathias Magnusson [email protected]

neilfernandez avatar Nov 03 '25 14:11 neilfernandez