Skip to content

[P1][bug] COLUMN_TYPES is incomplete — BIT, JSON, YEAR, BOOL, SERIAL, GEOMETRY fall back to VARCHAR on round-trip #382

Closed

Description

@EVWorth

Context

Table Designer column type dropdown and round-trip parser.

Problem

src/components/designer/TableDesigner.tsx:23-52 (COLUMN_TYPES) does not include BIT, JSON, YEAR, BOOL, BOOLEAN, SERIAL, GEOMETRY, POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, GEOMETRYCOLLECTION. extractBaseType (TableDesigner.tsx:920-940) falls back to VARCHAR for unknown types. A BIT(8) column loaded into the designer shows as VARCHAR; on save, it's re-emitted as VARCHAR(...) — silent data-type change. Same for JSON columns becoming VARCHAR(255), which then fails on INSERT of a JSON literal.

Files

  • src/components/designer/TableDesigner.tsx:23-52
  • src/components/designer/TableDesigner.tsx:920-940
  • src/lib/ddl-generator.ts:21-36 (TYPES_WITH_LENGTH)

Repro

  1. CREATE TABLE t (id INT, j JSON, b BIT(8))
  2. Open Table Designer in alter mode
  3. Click Apply Changes
  4. SHOW COLUMNS FROM t shows varchar(255) for j and b — data type lost

Expected

Round-trip preserves all column types.

Proposed fix

Add the missing types to COLUMN_TYPES: ["BIT", "BOOL", "BOOLEAN", "YEAR", "SERIAL", "JSON", "GEOMETRY", "POINT", "LINESTRING", "POLYGON", "MULTIPOINT", "MULTILINESTRING", "MULTIPOLYGON", "GEOMETRYCOLLECTION"]. Update TYPES_WITH_LENGTH in ddl-generator.ts:21-36 to include BIT, YEAR (which accepts (2|4)), JSON. Test the round-trip. Scope: S.

Acceptance

A BIT(8) NOT NULL column round-trips: load → save → SHOW COLUMNS shows bit(8). A JSON column round-trips. A POINT NOT NULL column round-trips.

Needs human verify

yes

Doc drift

no

Activity

  1. added
    audit
    severity/p1
    kind/bug
    area/designer
    on Jul 31, 2026
  2. added a commit that references this issue on Sep 5, 2026
    9eef999
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/designerauditkind/bugseverity/p1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions