OWNED_SHARES view
The MD_INFORMATION_SCHEMA.OWNED_SHARES view provides information about shares created by the current user.
note
Shares are region-scoped based on your Organization's cloud region. MotherDuck Organizations are currently scoped to a single cloud region that must be chosen at Org creation when signing up.
Schema
Querying the MD_INFORMATION_SCHEMA.OWNED_SHARES view will return query results that contain one row for each share created by the current user.
The MD_INFORMATION_SCHEMA.OWNED_SHARES view has the following schema:
| Column Name | Data Type | Value |
|---|---|---|
| NAME | STRING | The name of the share |
| URL | STRING | The share_url which can be used to attach the share |
| SOURCE_DB_NAME | STRING | The name of the database where this share was created from |
| SOURCE_DB_UUID | UUID | UUID of the database where this share was created from |
| ACCESS | STRING | Whether anyone (referred to as UNRESTRICTED) or only organization members (referred to as ORGANIZATION) can attach to the share by its share_url |
| GRANTS | STRUCT(username VARCHAR, access VARCHAR)[] | A list of all grants that are active for the share |
| VISIBILITY | STRING | Whether the share is DISCOVERABLE or HIDDEN |
| UPDATE | STRING | The share’s update mode (MANUAL vs. AUTOMATIC) |
| CREATED_TS | TIMESTAMP | The share’s creation time |
Example usage
from MD_INFORMATION_SCHEMA.OWNED_SHARES;
select name, url, created_ts from MD_INFORMATION_SCHEMA.OWNED_SHARES;
| name | url | source_db_name |
|---|---|---|
| my_share | md:_share/my_share/2ef6b580-2445-4f4f-bce8-c13a85812464 | db1 |