Skip to main content

MD_LIST_DIVE_VERSIONS

Lists all versions of a specific Dive with pagination support. Each time a Dive's content is updated using MD_UPDATE_DIVE_CONTENT, an additional version is created. This function returns version metadata without the content.

Syntax​

SELECT * FROM MD_LIST_DIVE_VERSIONS(id = 'your-dive-uuid'::UUID);
SELECT * FROM MD_LIST_DIVE_VERSIONS(
id = 'your-dive-uuid'::UUID,
"limit" = 100,
"offset" = 0
);

Parameters​

ParameterTypeRequiredDescription
idUUIDYesThe unique identifier of the Dive
limitUINTEGERNoMaximum number of versions to return
offsetUINTEGERNoNumber of versions to skip
tip

limit and offset are reserved SQL keywords and must be double-quoted when used as named parameters.

Return columns​

ColumnTypeDescription
idUUIDUUID of this version
versionUINTEGERVersion number (0-based)
storage_urlVARCHARStorage URL of the version content
descriptionVARCHARVersion description or commit message
created_atTIMESTAMP WITH TIME ZONEWhen this version was created
api_versionUINTEGERAPI version used to create this version

Examples​

List all versions of a Dive:

SELECT version, description, created_at
FROM MD_LIST_DIVE_VERSIONS(id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'::UUID);

Get the 5 most recent versions:

SELECT version, description, created_at
FROM MD_LIST_DIVE_VERSIONS(id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'::UUID)
ORDER BY version DESC
LIMIT 5;

Errors​

Returns an error if the Dive does not exist.