motherduck-share-data

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Share Data with MotherDuck

使用MotherDuck共享数据

Use this skill when you need to distribute a MotherDuck database without copying data. Shares are read-only, zero-copy database clones and should be treated as explicit provisioning operations.
当你需要无需拷贝数据即可分发MotherDuck数据库时,请使用此技能。共享是只读的零拷贝数据库克隆,应视为显式的资源调配操作。

Source Of Truth

权威来源

  • Prefer the current MotherDuck sharing docs and SQL reference first.
  • If the MotherDuck MCP
    ask_docs_question
    feature is available, use it before falling back to public docs.
  • Keep the sharing model aligned with the documented behavior:
    • zero-copy and metadata-only
    • database-granularity sharing
    • read-only recipients
    • owner-controlled update mode
  • 优先参考最新的MotherDuck共享文档和SQL参考手册。
  • 如果MotherDuck MCP的
    ask_docs_question
    功能可用,请先使用该功能,再 fallback 到公开文档。
  • 保持共享模型与文档记录的行为一致:
    • 零拷贝且仅涉及元数据
    • 数据库粒度的共享
    • 只读接收方
    • 所有者控制的更新模式

Prerequisites

前提条件

  • MotherDuck connection established via
    motherduck-connect
  • Source database identified via
    motherduck-explore
  • Share SQL validated via
    motherduck-query
  • 已通过
    motherduck-connect
    建立MotherDuck连接
  • 已通过
    motherduck-explore
    确定源数据库
  • 已通过
    motherduck-query
    验证共享SQL

Default Posture

默认配置

  • Default internal sharing to
    ACCESS ORGANIZATION
    ,
    VISIBILITY DISCOVERABLE
    , and
    UPDATE AUTOMATIC
    .
  • Use
    UPDATE MANUAL
    when the recipient needs a stable snapshot or versioned delivery.
  • Use
    ACCESS RESTRICTED
    or
    VISIBILITY HIDDEN
    when distribution should stay tightly controlled.
  • Confirm whether the recipient is an internal user, another organization, or public before choosing access and visibility.
  • For write-heavy publishers, verify the MotherDuck-supported DuckDB client version before relying on upstream checkpoint or concurrent-write improvements during share-update workflows.
  • Never treat a share as row-level security. Shares operate at database granularity.
  • 内部共享默认设置为
    ACCESS ORGANIZATION
    VISIBILITY DISCOVERABLE
    UPDATE AUTOMATIC
  • 当接收方需要稳定快照或版本化交付时,使用
    UPDATE MANUAL
  • 当分发需要严格控制时,使用
    ACCESS RESTRICTED
    VISIBILITY HIDDEN
  • 在选择访问权限和可见性之前,确认接收方是内部用户、其他组织还是公开用户。
  • 对于写入频繁的发布者,在依赖共享更新工作流中的上游检查点或并发写入改进之前,请验证MotherDuck支持的DuckDB客户端版本。
  • 切勿将共享视为行级安全控制。共享以数据库为粒度运作。

Workflow

工作流程

  1. Identify the exact database to publish and who should consume it.
  2. Decide sensitivity, discoverability, and freshness requirements before writing SQL.
  3. Create the share with explicit access, visibility, and update settings.
  4. If access is restricted, grant readers explicitly. If the share is hidden or link-based, distribute the share URL directly.
  5. Have recipients
    ATTACH
    the shared database and query it read-only.
  6. If the share uses
    UPDATE MANUAL
    , the owner runs
    UPDATE SHARE
    and consumers run
    REFRESH DATABASE
    when a new snapshot is ready.
  1. 确定要发布的具体数据库以及目标使用者。
  2. 在编写SQL之前,确定数据敏感度、可发现性和新鲜度要求。
  3. 创建具有明确访问权限、可见性和更新设置的共享。
  4. 如果访问权限受限,需显式授予读者权限。如果共享是隐藏的或基于链接的,请直接分发共享URL。
  5. 让接收方
    ATTACH
    共享数据库并以只读方式查询。
  6. 如果共享使用
    UPDATE MANUAL
    ,当新快照准备就绪时,所有者运行
    UPDATE SHARE
    ,消费者运行
    REFRESH DATABASE

Open Next

后续参考

  • references/SHARE_PLAYBOOK.md
    for the full SQL playbook, access/update decision matrix, consumer workflow, and common failure modes
  • references/SHARE_PLAYBOOK.md
    :包含完整的SQL操作手册、访问/更新决策矩阵、消费者工作流以及常见故障模式

Related Skills

相关技能

  • motherduck-connect
    for MotherDuck authentication and connection setup
  • motherduck-explore
    for discovering databases, tables, columns, and existing shares
  • motherduck-query
    for validating share SQL and downstream queries
  • motherduck-duckdb-sql
    for DuckDB SQL syntax and lookup support
  • motherduck-connect
    :用于MotherDuck身份验证和连接设置
  • motherduck-explore
    :用于发现数据库、表、列和现有共享
  • motherduck-query
    :用于验证共享SQL和下游查询
  • motherduck-duckdb-sql
    :用于DuckDB SQL语法和查询支持