-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6bd3af8
commit 76320ec
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
docs/en/sql-reference/10-sql-commands/00-ddl/17-dictionary/show-dictionaries.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
title: SHOW DICTIONARIES | ||
--- | ||
import FunctionDescription from '@site/src/components/FunctionDescription'; | ||
|
||
<FunctionDescription description="Introduced or updated: v1.2.646"/> | ||
|
||
Lists dictionaries in a specified database, displaying their names, column details, and source information. Please note that this command currently only lists dictionaries that use MySQL as the data source. | ||
|
||
## Syntax | ||
|
||
```sql | ||
SHOW DICTIONARIES [FROM | IN <database_name>] [LIKE '<pattern>'] [WHERE <condition>] | ||
``` | ||
|
||
## Examples | ||
|
||
This example lists all dictionaries in the current database: | ||
|
||
```sql | ||
SHOW DICTIONARIES; | ||
|
||
┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ | ||
│ database │ dictionary │ key_names │ key_types │ attribute_names │ attribute_types │ source │ comment │ | ||
├──────────┼────────────┼───────────────┼───────────────┼─────────────────────────────────┼─────────────────────────────┼──────────────────────────────────────────────────────────────────────────────────┼─────────┤ | ||
│ default │ order_dict │ ['order_id'] │ ['INT NULL'] │ ['customer_name','order_total'] │ ['VARCHAR NULL','INT NULL'] │ mysql(db=dict host=mysql password=[hidden] port=3306 table=orders username=root) │ │ | ||
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ | ||
``` | ||
|
||
This example uses the LIKE clause to filter dictionaries whose names start with 'order': | ||
|
||
```sql | ||
SHOW DICTIONARIES LIKE 'order%'; | ||
|
||
┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ | ||
│ database │ dictionary │ key_names │ key_types │ attribute_names │ attribute_types │ source │ comment │ | ||
├──────────┼────────────┼───────────────┼───────────────┼─────────────────────────────────┼─────────────────────────────┼──────────────────────────────────────────────────────────────────────────────────┼─────────┤ | ||
│ default │ order_dict │ ['order_id'] │ ['INT NULL'] │ ['customer_name','order_total'] │ ['VARCHAR NULL','INT NULL'] │ mysql(db=dict host=mysql password=[hidden] port=3306 table=orders username=root) │ │ | ||
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ | ||
``` | ||
|
||
This example uses the WHERE clause to show dictionaries with the exact name 'order_dict': | ||
|
||
```sql | ||
SHOW DICTIONARIES WHERE name = 'order_dict'; | ||
|
||
┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ | ||
│ database │ dictionary │ key_names │ key_types │ attribute_names │ attribute_types │ source │ comment │ | ||
├──────────┼────────────┼───────────────┼───────────────┼─────────────────────────────────┼─────────────────────────────┼──────────────────────────────────────────────────────────────────────────────────┼─────────┤ | ||
│ default │ order_dict │ ['order_id'] │ ['INT NULL'] │ ['customer_name','order_total'] │ ['VARCHAR NULL','INT NULL'] │ mysql(db=dict host=mysql password=[hidden] port=3306 table=orders username=root) │ │ | ||
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ | ||
``` |