DESCRIBE SHARE
The DESCRIBE SHARE
statement is used to get details about a specific share.
info
The creator of the share object can execute this statement by passing the share name. The receiver of the share object can execute this statement by passing the share link.
Syntax
DESCRIBE SHARE [<share name> | <share URL>];
Example
Let's use the sample_data
database which is auto attached to MotherDuck users to illustrate the command
DESCRIBE SHARE 'md:_share/sample_data/23b0d623-1361-421d-ae77-62d701d471e6';
It returns :
┌──────────────────────┬──────────────────────┬───────────────┬────────────────────────────────┬──────────────────────────────────────┐
│ share_name │ share_link │ database_name │ database_id │ snapshot_id │
│ varchar │ varchar │ varchar │ uuid │ uuid │
├──────────────────────┼──────────────────────┼───────────────┼────────────────────────────────┼──────────────────────────────────────┤
│ currency_rate_202306 │ md:_share/my_db/18… │ my_db │ 4945bc55-3a7c-42cf-b40b-941d… │ 57ee90e1-c78a-4453-82c4-68f11536c5ff │
└──────────────────────┴──────────────────────┴───────────────┴────────────────────────────────┴──────────────────────────────────────┘
column_name | column_type | description |
---|---|---|
share_name | VARCHAR | Name of the share |
share_link | VARCHAR | URL of the share |
database_name | VARCHAR | Name of the database shared |
database_id | UUID | uid of the database |
snapshot_id | UUID | uid of the snapshot |
You can be specific about what which columns you want to return by using the table function :
SELECT share_name, share_link, database_name, snapshot_id FROM md_describe_database_share('md:_share/sample_data/23b0d623-1361-421d-ae77-62d701d471e6');