Skip to content

feat(plugin-cassandra): list user-defined types, offer them in the type picker and drop them - #3719

Merged
datlechin merged 2 commits into
mainfrom
feat/2528-cassandra-udt
Oct 20, 2026
Merged

datlechin merged 2 commits into
mainfrom
feat/2528-cassandra-udt

Conversation

@datlechin

@datlechin datlechin commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Cassandra and ScyllaDB list a keyspace's user-defined types under Types, read from system_schema.types. Opening one shows its fields and a rebuilt CREATE TYPE, with Open in Editor.
  • The structure editor's type picker offers the table's keyspace types. An entry is wrapped in frozen<…> when a plain column cannot hold it: a field is a non-frozen collection, the server predates 3.6, or it is ScyllaDB (reports 3.0.8). Names are quoted like Cassandra's maybeQuote, plus CQL type names, so a type called "text" is never spelled as the native text.
  • Drop Type… on a type row, for every engine whose driver writes the statement: Cassandra and ScyllaDB, PostgreSQL and PGlite (DROP DOMAIN for a domain), SQL Server. The gate shows the statement and confirms it as destructive; the server's refusal while a table or type still uses it is shown as is. Hidden on read-only connections.
  • PluginKit, additive (kit stays 40): PluginUserDefinedTypeKind.udt ("User-Defined Type", CQL's word, as feat(plugin-mssql): browse SQL Server alias, table and CLR types #2856 did for SQL Server) and generateDropTypeSQL(type:) defaulting to nil. MCP list_types accepts kind: "udt"; UserDefinedTypeToolSchemaTests is updated for it.
  • CassandraObjectQueries.elements(of:) no longer trims spaces and quotes off list elements, which renamed a field or argument such as "customer'".
  • Cancelling the gate's confirmation of Refresh Materialized View or Edit Comment no longer reports "Operation cancelled by user" as a failure.
  • apple/scripts/probes/check-cassandra-user-types.sh runs the type code against a live server.
  • Changelog: 3719.added.md, 3719.added.1.md, 3719.fixed.md, 3719.fixed.1.md.

Test plan

  • UserTypeDroppingTests, new: the drop runs on the scope's pooled driver, a denial runs nothing, a cancel stays a cancel, the adapter forwards the type, Support lists droppable kinds.
  • DatabaseTreeMenuSpecTests, UserDefinedTypeInfoTests, PluginMetadataRegistryCuratedCapabilityTests (Cassandra and ScyllaDB browse types before the plugin loads), PostgreSQLTypeQueryTests: fail on main, pass here. 190 tests in the touched suites pass; AllPlugins builds.
  • Probe against Cassandra 5.0.9: every rebuilt CREATE TYPE round-trips, including names with quotes, spaces and commas; each picker spelling is accepted and is the type ("text" and "byte" included); the bare name is refused wherever the spelling is frozen; DROP TYPE is refused while in use and runs once nothing uses the type. Not run against ScyllaDB or Cassandra 3.x/4.x.

Not in this PR

  • A SQL dump writes types by name, so a type whose field uses a later-named type (contact holding frozen<phone>, or a PostgreSQL composite over a later domain) is created before its dependency and the restore stops there (SQLExportPlugin.writeObjectCreatePhase, sorted by (dumpOrder, name)).
  • Materialized views still do not appear in the Cassandra sidebar.

Docs: TableProApp/docs#76

Fixes #2528

@datlechin
datlechin enabled auto-merge (squash) October 20, 2026 20:06
@datlechin
datlechin merged commit ab08c80 into main Oct 20, 2026
9 checks passed
@datlechin
datlechin deleted the feat/2528-cassandra-udt branch October 21, 2026 03:55
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.

Cassandra user-defined types in the sidebar and structure editor

1 participant