Skip to content

feat(datagrid): show pgvector columns as vectors, not long text - #3725

Merged
datlechin merged 6 commits into
mainfrom
feat/3599-pgvector-columns
Oct 21, 2026
Merged

datlechin merged 6 commits into
mainfrom
feat/3599-pgvector-columns

Conversation

@datlechin

@datlechin datlechin commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Summary

  • The PostgreSQL driver finds pgvector's vector, halfvec and sparsevec types on connect, and spells a column read from a table with its dimension count from PQfmod: vector(1536).
  • New vector column type. The grid draws [0.0123, -0.0456, 0.0789, …] 1536 dims instead of the whole literal.
  • Double-click, Return or the chevron opens a viewer: one element per row with its index, Copy as JSON, Edit as Text. The row inspector opens the same viewer.
  • Save refuses a value whose length differs from its vector(n) column and names the column, before anything reaches the server. The viewer disables OK on a wrong length.
  • An emptied vector cell stages NULL instead of '', which pgvector refuses.

Not in this PR

  • vector(n), halfvec(n) and sparsevec(n) in the Structure type picker when the extension is installed: the picker has no source for extension base types without a new PluginKit API. Typing vector(1536) there works today.
  • Fetching large values only when a cell opens: Fetch BLOB values only when a cell is opened #2490.

Test plan

  • New: PgvectorTypesTests, VectorLiteralTests, ColumnTypeVectorTests, CellDisplayFormatterVectorTests, CellInteractionResolverVectorTests, FieldEditorResolverVectorTests, RowChangeStatementFactoryVectorTests. None compiles on main.
  • Unit runs over the changed types: 439 passed, and 150 after the review fixes.
  • Measured on pgvector 0.8.7, PostgreSQL 17: text forms, PQfmod 1536 on a table column, PQftable 0 on v::vector(2), the server's expected 3 dimensions, not 2, and the probe skipping a composite named vector.

Screenshots

Before, a vector cell drew its literal, [0.0989,0.0412,-0.0544,-0.1,…, to the column's edge. The old build would not launch under XCUITest here, so there is no before shot.

Grid, light
Grid, dark
Viewer, light
Viewer over the grid, dark

Fixes #3599

@datlechin
datlechin enabled auto-merge (squash) October 20, 2026 21:46
@datlechin
datlechin merged commit 2d47cd8 into main Oct 21, 2026
8 checks passed
@datlechin
datlechin deleted the feat/3599-pgvector-columns branch October 21, 2026 04:00
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.

Show pgvector columns as vectors, not long text

1 participant