Skip to content

feat: show common PostgreSQL type aliases in the UI - #1553

Merged
sorenbs merged 1 commit into
mainfrom
feat/1416-datatype-aliases
Jul 18, 2026
Merged

feat: show common PostgreSQL type aliases in the UI#1553
sorenbs merged 1 commit into
mainfrom
feat/1416-datatype-aliases

Conversation

@sorenbs

@sorenbs sorenbs commented Jul 18, 2026

Copy link
Copy Markdown
Member

Fixes #1416

PostgreSQL catalogs columns under internal names (int8, int4, bpchar, …) that confuse users who declared bigint, integer, char. Studio now displays the common alias in the display layer only:

  • int8bigint, int4integer, int2smallint, float8double precision, float4real, boolboolean, bpcharchar; arrays keep the [] suffix around the aliased element (int8[]bigint[]).
  • Gated on datatype.schema === "pg_catalog", so user-defined types (even one literally named int8 in another schema) and MySQL/SQLite types pass through unchanged.
  • timestamptz/timetz deliberately stay as-is — short, widely used, and the full names are too long for header cells.
  • Applied to grid headers, the filter column picker (search now matches the alias too — typing "bigint" finds int8 columns), and the schema visualizer. Type metadata used for filtering, editing, and SQL generation is untouched.

Verification

22 table-driven helper tests + a rendered-header assertion; existing suites for the touched components pass (typecheck/lint clean). FEATURES.md documented; changeset included (patch).

🤖 Generated with Claude Code

Native pg_catalog type names like int8 confuse users who know these
types by their SQL spellings. Display them via their common aliases
(int8 -> bigint, int4 -> integer, int2 -> smallint, float8 -> double
precision, float4 -> real, bool -> boolean, bpchar -> char) in the
grid header, filter column picker, and schema visualizer, preserving
the [] suffix for array types. Familiar short names (timestamptz,
varchar, ...) stay as-is, user-defined types and other dialects are
untouched, and the mapping is display-only.

Closes #1416

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: eaf83500-d536-4fd9-91c8-22a46e5baab5

📥 Commits

Reviewing files that changed from the base of the PR and between 81354ff and bd87f0a.

📒 Files selected for processing (8)
  • .changeset/postgres-datatype-aliases.md
  • FEATURES.md
  • ui/hooks/use-schema-visualization.tsx
  • ui/lib/datatype-display.test.ts
  • ui/lib/datatype-display.ts
  • ui/studio/grid/DataGridHeaderCell.test.tsx
  • ui/studio/grid/DataGridHeaderCell.tsx
  • ui/studio/views/table/InlineTableFilters.tsx

Summary by CodeRabbit

  • New Features

    • PostgreSQL datatypes now appear with familiar SQL aliases throughout Studio, including table headers, column filters, and the schema visualizer.
    • Array types are displayed using readable aliases, such as int8[] as bigint[].
  • Documentation

    • Added documentation for readable PostgreSQL type names and clarified that aliases affect display only.

Walkthrough

Studio now displays common PostgreSQL SQL aliases instead of native catalog names in table headers, filter column labels, and schema visualization fields. A shared formatter handles recognized pg_catalog types and array forms while preserving user-defined and non-PostgreSQL names. Tests cover alias mappings and display-surface behavior, and documentation plus a patch changeset describe the update.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main UI change to display common PostgreSQL type aliases.
Description check ✅ Passed The description matches the changeset and describes the PostgreSQL alias display behavior, tests, and docs updates.
Linked Issues check ✅ Passed The PR implements #1416 by displaying common PostgreSQL catalog aliases in the UI while preserving underlying type metadata.
Out of Scope Changes check ✅ Passed All code, tests, docs, and changeset updates are directly related to PostgreSQL type-alias display behavior.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/1416-datatype-aliases
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch feat/1416-datatype-aliases

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

Compute preview deployed.

Branch: feat/1416-datatype-aliases
Service: feat-1416-datatype-aliases
Preview: https://xzatvecs61o24fgsizkyio4w.cdg.prisma.build

@sorenbs

sorenbs commented Jul 18, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@sorenbs

sorenbs commented Jul 18, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.


You're currently rate limited under our Fair Usage Limits Policy. Your recent PR review activity is in the 95th percentile or higher among CodeRabbit users, so adaptive limits apply. Your next review will be available in 34 minutes.

@sorenbs

sorenbs commented Jul 18, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@sorenbs
sorenbs merged commit 9eeb555 into main Jul 18, 2026
3 checks passed
@sorenbs
sorenbs deleted the feat/1416-datatype-aliases branch July 18, 2026 13:02
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.

Consider mapping datatypes to commonly used aliases.

1 participant