Building a Data Stack Live with AI AgentsLivestream August 18

Skip to main content

Managing shares

The Shares page under SettingsDataShares lists the databases you've shared and the ones shared with you, alongside the SQL commands below.

https://app.motherduck.com/settings/shares

Shares settings page

Reading the Shares page

For each share you've created, the Shares page shows:

  • Share name: The share name, with its source database shown below it.
  • Owner: The user who created the share.
  • Visibility: Whether the share is Discoverable (teammates can find it without the share URL) or Hidden.
  • Access type: Who can attach and query the share: Organization, Restricted (only specified users), or Unrestricted (any MotherDuck user with the link).
  • Update mode: Whether the share refreshes Automatically when the source database changes or Manually through the UPDATE SHARE command.
  • Created at and Last updated: When the share was created and last refreshed.

Viewing every Share in the organization requires permission to view all organization Shares, which the Admin preset role includes by default. With that permission, switch between the Just me and My org views.

Getting details about a share

You can learn more about a specific share that you've created by using DESCRIBE SHARE command. For example:

-- if you are the share owner, use the database name
DESCRIBE SHARE "duckshare";

-- if you are the share viewer, use the full url
DESCRIBE SHARE "md:_share/sample_data/23b0d623-1361-421d-ae77-62d701d471e6";

Listing Shares

You can list the shares you have created with the LIST SHARES statement. For example:

LIST SHARES;

To view the URLs of shares created by others that you have attached, use the SHOW ALL DATABASES command. The fully_qualified_name column gives you the share URL of the attached share.

Deleting a share

Shares can be deleted with the DROP SHARE or DROP SHARE IF EXISTS method. For example:

Users who have ATTACH-ed it will lose access.

DROP SHARE "share1";

Updating a share

Sharing a database creates a point-in-time snapshot of the database at the time it is shared. To publish changes, you need to explicitly run UPDATE SHARE <share name>.

When updating a SHARE with the same database, the URL does not change.

UPDATE SHARE <share name>;

In the following example, the sales database was previously shared by creating a share named sales_share, and the sales database has been updated since. The database owner wants their colleagues to receive the updated version of this database:

# 'sales_share' was previously created on the database 'sales'
UPDATE SHARE "sales_share";

If you lost your database share url, you can use the LIST SHARES command to list all your share or DESCRIBE SHARE <share name> to get specific details about a given share name.

Editing/Altering a share

You can change the configuration of shares you've created in the UI. SQL operation ALTER SHARE is in the works.

  1. Roll over the share you'd like to edit.
  2. Click on the "trident" on the right side.
  3. Select "Alter".
  4. Change the share configuration as you see fit.
  5. Confirm "Alter share".

Error handling: If you don't see the trident icon, you may not have permission to edit this share.