DESCRIBE VIEWS¶
The DESCRIBE VIEWS
command enables creating a list of database views.
Note
DESCRIBE
commands use CPU to increase usability.
Syntax¶
DESC[RIBE] VIEWS [ DATABASE "<database_name>" ] [ SCHEMA "<schema_name>" ] [ LIKE '<pattern>' ]
Parameters¶
Parameter |
Parameter Type |
Description |
---|---|---|
|
The name of the database to search within |
|
|
The name of the schema to search within |
|
|
String pattern to match |
Output¶
Parameter |
Data Type |
Description |
---|---|---|
|
|
Displays the table creation timestamp |
|
|
Displays the name of the view |
|
|
Displays the name of the database |
|
|
Displays the name of the schema |
|
|
Displays the SQL statement used to create the view |
Examples¶
DESCRIBE VIEWS
command:
DESCRIBE VIEWS;
Output:
created_on |name |database|schema|sql |
-------------------+------------------+--------+------+------------------------------------------------------------------------------------------------+
2022-12-15 07:29:07|cool_animals_view |master |public|create view "public".cool_animals_view as select * from cool_animals; |
2022-12-15 15:12:29|only_heavy_animals|master |public|create view "public".only_heavy_animals as select * from cool_animals where weight > 1000;|
DESCRIBE VIEWS LIKE
command:
DESCRIBE VIEWS LIKE 'only%';
Output:
created_on |name |database|schema|sql |
-------------------+----------------------+--------+------+----------------------------------------------------------------------------------------------------+
2022-12-15 15:12:29|only_heavy_animals |master |public|create view "public".only_heavy_animals as select * from cool_animals where weight > 1000; |
2022-12-20 11:14:16|only_agressive_animals|master |public|create view "public".only_agressive_animals as select * from cool_animals where weight > 1000;|
Permissions¶
This command requires a CONNECT
permission on the database level and a USAGE
permission on the schema level.