From b4880e9dd38c837f68e2088321c8d78b62c5273e Mon Sep 17 00:00:00 2001 From: Ngo Quoc Dat Date: Wed, 21 Oct 2026 02:58:21 +0700 Subject: [PATCH] docs(features): Cassandra user-defined types, and Drop Type --- databases/cassandra.mdx | 2 +- developers/mcp-tools.mdx | 2 +- features/user-defined-types.mdx | 13 +++++++++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/databases/cassandra.mdx b/databases/cassandra.mdx index 79e664ba..242791be 100644 --- a/databases/cassandra.mdx +++ b/databases/cassandra.mdx @@ -100,7 +100,7 @@ Both verifying modes need a **CA Certificate** path, and refuse to connect witho - A page far into a large table is slow, because every row before it is read first. Filter the table down, or query it in the CQL editor with a `WHERE` on the partition key. - Counter columns cannot be set with a plain `UPDATE`. The grid will edit one and the server rejects the statement it generates. Use `UPDATE … SET c = c + 1` in the CQL editor. -- Materialized views and UDTs do not appear in the sidebar. Query `system_schema` in the CQL editor to see them. UDFs and UDAs are listed under Functions; see [Procedures, functions, and triggers](/features/routines-triggers). +- Materialized views do not appear in the sidebar. Query `system_schema.views` in the CQL editor to see them. UDFs and UDAs are listed under Functions; see [Procedures, functions, and triggers](/features/routines-triggers). User-defined types are listed under Types; see [User-Defined Types](/features/user-defined-types). - The DDL tab reconstructs `CREATE TABLE` from the column list, so table options (compaction, compression, `gc_grace_seconds`), clustering order, and the split between partition and clustering key are all missing from it. Read the real definition with `DESCRIBE TABLE` in `cqlsh`. - DataStax Astra DB does not connect. The Secure Connect Bundle it requires cannot be loaded, and there is no way around it. - The connect timeout comes from the connection's **Options** section. The CQL request timeout diff --git a/developers/mcp-tools.mdx b/developers/mcp-tools.mdx index 1b67b5dc..36551b5d 100644 --- a/developers/mcp-tools.mdx +++ b/developers/mcp-tools.mdx @@ -111,7 +111,7 @@ The two `switch_` tools move what the user sees in TablePro. To run one statemen `get_database_statistics` leaves out a field the engine does not report. On PostgreSQL, `table_count` comes back only when `database` names the database the connection is browsing, and `size_bytes` only for a database the role has `CONNECT` on. -`list_routines` takes `kind` as `procedure` or `function`, omitted for both, and its `signature` is the argument list, not the return type. `list_triggers` takes `table` to scope to one table, omitted for every trigger in the schema. `list_types` takes `kind` as `enum`, `composite`, `domain` or `range`, omitted for all four; `labels` is set for an enum, `fields` for a composite and `base_type` for a domain or range, and only PostgreSQL and PGlite answer with rows. +`list_routines` takes `kind` as `procedure` or `function`, omitted for both, and its `signature` is the argument list, not the return type. `list_triggers` takes `table` to scope to one table, omitted for every trigger in the schema. `list_types` takes `kind` as `enum`, `composite`, `domain`, `range`, `aliasType`, `tableType`, `clrType` or `udt`, omitted for every kind; `labels` is set for an enum, `fields` for a composite or a `udt`, and `base_type` for a domain or range. PostgreSQL and PGlite answer with the first four kinds, SQL Server with `aliasType`, `tableType` and `clrType`, Cassandra and ScyllaDB with `udt`, and every other engine with no rows. ### `search_schema` diff --git a/features/user-defined-types.mdx b/features/user-defined-types.mdx index 546d2836..cc1146dc 100644 --- a/features/user-defined-types.mdx +++ b/features/user-defined-types.mdx @@ -1,9 +1,9 @@ --- title: User-Defined Types -description: Browse a schema's enums, composites, domains and ranges and read each definition +description: Browse the types a schema or keyspace declares, read each definition, and drop one --- -Expand a schema and **Types** sits beside **Functions** and **Triggers**, one row per enum, composite, domain and range the schema declares. Select a row and press Return, or double-click it, and the type's `CREATE` statement opens in a tab. +Expand a schema, or a keyspace on Cassandra and ScyllaDB, and **Types** sits beside **Functions** and **Triggers**, one row per type it declares. Select a row and press Return, or double-click it, and the type's `CREATE` statement opens in a tab. Sidebar tree with the Types section expanded under a PostgreSQL schema, and a tab showing the rebuilt CREATE TYPE statement @@ -16,6 +16,7 @@ Expand a schema and **Types** sits beside **Functions** and **Triggers**, one ro |---|---| | PostgreSQL, PGlite | Enums, composites, domains, ranges | | SQL Server | Alias types, table types, CLR types | +| Cassandra, ScyllaDB | User-defined types | | Every other engine | None | A table's own row type, the array type created beside every type, the multirange created beside every range, and any type an extension installed are left out. A type in another schema is listed under that schema. On SQL Server the built-in types are left out too, so the section holds only what the database declares. @@ -30,14 +31,22 @@ On SQL Server nothing is stored to read back at all, because a type has no `sys. A SQL Server table type is a table-valued parameter and cannot declare a column, so it is left out of the column type picker. Alias types appear there. +On Cassandra the statement is rebuilt from `system_schema.types`: the fields in declaration order, each with the type the server reports. + ## Changing or creating a type The tab is read-only. **Open in Editor** puts the definition in a query tab; write the `ALTER TYPE` or `CREATE TYPE` there and run it, then choose **Refresh** on the **Types** section. On PostgreSQL, `ALTER TYPE … ADD VALUE` adds an enum label and, from PostgreSQL 10, `RENAME VALUE` renames one. No statement removes a label or moves an existing one. +## Dropping a type + +Right-click a type and choose **Drop Type…**. The `DROP TYPE` statement (`DROP DOMAIN` for a PostgreSQL domain) is shown for confirmation before it runs, and the **Types** section refreshes once it has. The server refuses while a table, or another type, still uses the type, and its reason is shown. A read-only connection has no **Drop Type…**. + ## Using a type in a column In a table's **Structure** tab, the column type picker opens with a **User-Defined** group listing the types of every schema the sidebar's [schema filter](/features/connection-window#filtering-schemas) keeps, and of the table's own schema, ahead of the engine's. Every entry is schema-qualified and quoted where the name needs it, `sales.status` or `app."Order Status"`, so the column definition names the type and never a built-in of the same name. See [Table Structure](/features/table-structure#columns-tab). +On Cassandra and ScyllaDB the group lists the types of the table's own keyspace, the only one a column can use, by name, quoted where the name needs it. An entry comes wrapped as `frozen
` where a plain column cannot hold the type: when a field is a collection that is not frozen, on Cassandra before 3.6, and on ScyllaDB. + ## Finding a type The sidebar filter matches a type by name. **File > Open Quickly…** (`Cmd+Shift+O`) indexes types alongside tables, routines and triggers, and choosing one opens its definition.