Skip to content

Fix column type classification across all databases#462

Open
datlechin wants to merge 2 commits intomainfrom
feat/fix-column-type-classification-all-databases
Open

Fix column type classification across all databases#462
datlechin wants to merge 2 commits intomainfrom
feat/fix-column-type-classification-all-databases

Conversation

@datlechin
Copy link
Collaborator

Summary

  • Extract ColumnTypeClassifier from PluginDriverAdapter with a dictionary-driven, three-phase pipeline: strip wrappers (Nullable/LowCardinality) → extract base type + params → classify via lookup + fallback patterns
  • Fix type misclassification for MySQL TINYINT(1) (now boolean), INT(11)/BIGINT(20) (now integer), MSSQL BIT (boolean), MONEY/SMALLMONEY (decimal), IMAGE/VARBINARY(N) (blob), DATETIME2/DATETIMEOFFSET/SMALLDATETIME (datetime), ClickHouse Nullable()/LowCardinality() wrappers, Enum8/Enum16/DateTime64, DuckDB unsigned integers (UTINYINT, USMALLINT, UINTEGER, UBIGINT, HUGEINT)
  • Add parseClickHouseEnumValues for Enum8('a'=1,'b'=2) format and wire into fetchEnumValues()
  • Fix isLongText to include MSSQL NTEXT
  • ~100 new test cases covering all database types

Closes #461

Test plan

  • All ColumnTypeClassifierTests pass (~100 test cases across MySQL, MSSQL, ClickHouse, DuckDB, PostgreSQL, SQLite, Oracle suites)
  • All ColumnTypeTests pass (existing 24 + 10 new tests for ClickHouse enum parsing and NTEXT)
  • All related tests pass (PluginDriverAdapterTableOpsTests, ColumnTypeBadgeLabelTests, CellDisplayFormatterTests)
  • Manual: Connect to PostgreSQL with enum columns → verify dropdown picker in data grid and detail sidebar
  • Manual: Connect to ClickHouse with Enum8/Enum16 columns → verify dropdown picker
  • Manual: Connect to MSSQL with BIT columns → verify boolean toggle
  • Manual: Connect to MySQL with TINYINT(1) columns → verify boolean toggle

Extract ColumnTypeClassifier from PluginDriverAdapter with dictionary-driven
classification, wrapper stripping (Nullable/LowCardinality), and database-specific
conventions (MySQL TINYINT(1), MSSQL BIT). Add ClickHouse Enum8/Enum16 value
parsing and NTEXT long text support.
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.

Support enum type in PostgreSQL

1 participant