Building a Data Stack Live with AI AgentsLivestream August 18

Skip to main content

MD_LIST_GUIDES

Preview
This feature is in preview and is subject to change.

List Guides visible to you — topics and titles, without content. Read a guide in full with MD_GET_GUIDE.

Syntax

SELECT * FROM MD_LIST_GUIDES();

-- With optional filters
SELECT * FROM MD_LIST_GUIDES(
topic = 'revenue-billing',
"limit" = 10,
"offset" = 0
);

Parameters

ParameterTypeRequiredDescription
topicVARCHARNoFilter to a topic subtree — the topic itself and everything below it. 'core' matches core and core/metrics but not core-metrics. An empty string matches everything.
referenceSTRUCTNoReverse lookup: return only guides that reference a specific object. See reference struct.
"limit"UINTEGERNoMaximum number of guides to return.
"offset"UINTEGERNoNumber of guides to skip (for pagination).

Reference struct

The reference parameter accepts a struct with these fields:

FieldTypeDescription
typeVARCHARRequired. One of 'catalog', 'dive', 'flight', or 'guide'.
urlVARCHARMotherDuck URL — required for catalog type (for example 'md:my_database' or a 'md:_share/...' URL).
schemaVARCHARSchema name — required when table, view, or macro is set.
tableVARCHARTable name (catalog only).
columnVARCHARColumn name (catalog only, requires table).
viewVARCHARView name (catalog only, mutually exclusive with table/macro).
macroVARCHARMacro name (catalog only, mutually exclusive with table/view).
uuidUUIDUUID of the referenced Dive, Flight, or Guide.
descriptionVARCHARWhy this reference exists.

Return columns

ColumnTypeDescription
idUUIDUnique identifier of the guide
topicVARCHARGrouping label (NULL for guides without a topic)
titleVARCHARGuide title
descriptionVARCHAROne-line summary
owner_idUUIDUUID of the guide owner
owner_nameVARCHARName of the guide owner
accessVARCHAR'user' (private) or 'organization' (org-wide)
current_versionUINTEGERLatest version number
created_atTIMESTAMP WITH TIME ZONEWhen the guide was created
updated_atTIMESTAMP WITH TIME ZONEWhen the guide was last updated

Guides without a topic sort first.

Examples

List all guides visible to you:

SELECT id, topic, title, access FROM MD_LIST_GUIDES();

Filter to a topic subtree:

SELECT id, title, description
FROM MD_LIST_GUIDES(topic = 'revenue-billing')
ORDER BY topic, title;

Find guides that reference a specific table (unset struct fields can be omitted):

SELECT id, title
FROM MD_LIST_GUIDES(
reference = {
'type': 'catalog',
'url': 'md:billing',
'schema': 'main',
'table': 'subscriptions'
}
);

Find guides that reference a specific column:

SELECT id, title
FROM MD_LIST_GUIDES(
reference = {
'type': 'catalog',
'url': 'md:billing',
'schema': 'main',
'table': 'subscriptions',
'column': 'amount'
}
);

Paginate through all guides:

SELECT id, title
FROM MD_LIST_GUIDES("limit" = 20, "offset" = 40);