Virtual Workshop: Build a Serverless Lakehouse with DuckLakeDecember 17, 10am PT / 1pm ET

Skip to main content

LIST SHARES

The LIST SHARES statement lists all shares created by the current user.

It provides the same information as querying the MD_INFORMATION_SCHEMA.OWNED_SHARES view. You can also use the table function md_list_database_shares() for a subset of this information.

tip

To see shares that have been shared with you (by others), query the MD_INFORMATION_SCHEMA.SHARED_WITH_ME view instead.

Syntax

-- Using DDL (lists all owned shares with details)
LIST SHARES;

-- Equivalent to querying the information schema view
SELECT * FROM MD_INFORMATION_SCHEMA.OWNED_SHARES;

-- Using table function (returns a subset of columns)
SELECT name, url, source_db_name FROM md_list_database_shares();

Output

The LIST SHARES statement and SELECT * FROM MD_INFORMATION_SCHEMA.OWNED_SHARES return a table with the following columns:

Column NameData TypeValue
NAMESTRINGThe name of the share
URLSTRINGThe share_url which can be used to attach the share
SOURCE_DB_NAMESTRINGThe name of the database where this share was created from
SOURCE_DB_UUIDUUIDUUID of the database where this share was created from
ACCESSSTRINGWhether anyone (UNRESTRICTED) within the same cloud region or only organization members (ORGANIZATION) can attach to the share by its share_url. RESTRICTED shares are hidden from the list.
VISIBILITYSTRINGWhether the share is DISCOVERABLE or HIDDEN
UPDATESTRINGThe share's update mode (MANUAL vs. AUTOMATIC)
CREATED_TSTIMESTAMPThe share's creation time
note

Shares are region-scoped based on your Organization's cloud region. Each MotherDuck Organization is currently scoped to a single cloud region that must be chosen at Org creation when signing up.

MotherDuck is currently available on AWS in two regions:

  • US East (N. Virginia): us-east-1
  • Europe (Frankfurt): eu-central-1