Skip to main content

ATTACH <share>

Sharing in MotherDuck is done through shares. Recipient of a share must ATTACH the share, which creates a read-only database. This is a zero-copy, zero-cost, metadata-only operation. Learn more about sharing in MotherDuck.

Syntax

ATTACH <share URL> [AS <database name>];

Shorthand Convention

You may choose to name the new database by using AS <database name>. If you omit this clause, the new database will be given the same name as the source database that's being shared.

Example usage

ATTACH 'md:_share/ducks/0a9a026ec5a55946a9de39851087ed81' AS birds;   # attaches the share as database `birds`
ATTACH 'md:_share/ducks/0a9a026ec5a55946a9de39851087ed81'; # attaches the share as database `ducks`