The DESCRIBE command prints the DDL statements for schema objects in Lindorm Cassandra Query Language (CQL). Use these statements to inspect the structure of keyspaces, tables, and indexes, or to recreate them in another environment.
Lindorm CQL supports the following DESCRIBE variants:
| Variant | Description |
|---|---|
DESCRIBE KEYSPACES | Lists the names of all keyspaces |
DESCRIBE KEYSPACE [keyspace_name] | Shows the DDL of a keyspace and all schema objects it contains |
DESCRIBE TABLES | Lists the names of all tables in a specified keyspace |
DESCRIBE TABLE [keyspace_name.] table_name | Shows the DDL of a table |
DESCRIBE INDEX [keyspace_name.] index_name | Shows the DDL of an index |
DESCRIBE KEYSPACES
Lists the names of all keyspaces.
Syntax
DESCRIBE KEYSPACESOutput fields
| Field | Type | Description |
|---|---|---|
keyspace_name | text | The name of the keyspace. |
name | text | The name of the schema object. |
Example
DESCRIBE KEYSPACES;DESCRIBE KEYSPACE
Shows the DDL of a keyspace and all schema objects it contains. Schema objects include tables, user-defined types (UDTs), and user-defined functions (UDFs).
Syntax
DESCRIBE KEYSPACE [keyspace_name]Ifkeyspace_nameis omitted, the command returns schema objects in the current keyspace. Ifkeyspace_nameis specified, the command returns schema objects in that keyspace.
Parameters
| Parameter | Type | Description |
|---|---|---|
keyspace_name | text | The name of the keyspace. |
Output fields
| Field | Type | Description |
|---|---|---|
name | text | The name of the schema object. |
create_statement | text | The Lindorm CQL statement used to recreate the schema object. |
Example
DESCRIBE KEYSPACE testks;DESCRIBE TABLES
Lists the names of all tables in a specified keyspace. If the specified keyspace does not exist, the command lists all keyspaces instead.
Syntax
DESCRIBE TABLESOutput fields
| Field | Type | Description |
|---|---|---|
keyspace_name | text | The name of the keyspace. |
name | text | The name of the schema object. |
Example
DESCRIBE TABLESDESCRIBE TABLE
Shows the DDL of a table as a Lindorm CQL statement that can be used to recreate the table.
Syntax
DESCRIBE TABLE [keyspace_name.] table_nameParameters
| Parameter | Type | Description |
|---|---|---|
keyspace_name | text | The name of the keyspace. Optional. If omitted, the current keyspace is used. |
table_name | text | The name of the table. |
Output fields
| Field | Type | Description |
|---|---|---|
name | text | The name of the schema object. |
create_statement | text | The Lindorm CQL statement used to recreate the table. |
Example
DESCRIBE TABLE persioninfo;DESCRIBE INDEX
Shows the DDL of a table index as a Lindorm CQL statement that can be used to recreate the index.
Syntax
DESCRIBE INDEX [keyspace_name.] index_nameParameters
| Parameter | Type | Description |
|---|---|---|
keyspace_name | text | The name of the keyspace. Optional. If omitted, the current keyspace is used. |
index_name | text | The name of the index. |
Output fields
| Field | Type | Description |
|---|---|---|
name | text | The name of the schema object. |
create_statement | text | The Lindorm CQL statement used to recreate the index. |
Example
DESCRIBE INDEX testks.myindex;