MD_LIST_DIVES
Lists all Dives in your MotherDuck account. Returns metadata for each Dive without the component content.
Syntax
SELECT * FROM MD_LIST_DIVES();
SELECT * FROM MD_LIST_DIVES("limit" =100, "offset" =0);
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | UINTEGER | No | Maximum number of Dives to return |
offset | UINTEGER | No | Number of Dives to skip |
include_org_shares | BOOLEAN | No | Include Dives shared with your organization. Defaults to false. |
tip
limit and offset are reserved SQL keywords and must be double-quoted when used as named parameters.
Return columns
| Column | Type | Description |
|---|---|---|
id | UUID | Unique identifier of the Dive |
title | VARCHAR | Dive title |
description | VARCHAR | Dive description |
owner_id | UUID | UUID of the Dive owner |
current_version | INTEGER | Latest version number (1-based) |
created_at | TIMESTAMP WITH TIME ZONE | When the Dive was created |
updated_at | TIMESTAMP WITH TIME ZONE | When the Dive was last updated |
owner_name | VARCHAR | Name of the Dive owner |
status | VARCHAR | The Dive's status: draft, ready, endorsed, or archived |
status_changed_at | TIMESTAMP WITH TIME ZONE | When the status was last set (NULL until someone sets it) |
status_set_by | UUID | UUID of the user who set the status (NULL until someone sets it) |
status_applies_to_version | UINTEGER | The version the status was set against (NULL until someone sets it) |
Examples
List all Dives:
SELECT * FROM MD_LIST_DIVES();
List the 10 Dives with the latest updates:
SELECT id, title, owner_name, updated_at
FROM MD_LIST_DIVES()
ORDER BY updated_at DESC
LIMIT 10;
List endorsed Dives:
SELECT id, title, owner_name, status_changed_at
FROM MD_LIST_DIVES()
WHERE status = 'endorsed';
Paginate through Dives:
SELECT * FROM MD_LIST_DIVES("limit" =20, "offset" =0); -- first page
SELECT * FROM MD_LIST_DIVES("limit" =20, "offset" =20); -- second page
Related
MD_GET_DIVE— Read a Dive including its contentMD_UPDATE_DIVE_STATUS— Set a Dive's statusMD_LIST_DIVE_VERSIONS— List version history for a Divelist_divesMCP tool — AI assistant equivalent