MD_LIST_DIVE_VERSIONS
Public Preview
Dives are currently in public preview and functionality is subject to change.
Lists all versions of a specific Dive with pagination support. Each time a Dive's content is updated via MD_UPDATE_DIVE_CONTENT, a new 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
| Parameter | Type | Required | Description |
|---|---|---|---|
id | UUID | Yes | The unique identifier of the Dive |
limit | UINTEGER | No | Maximum number of versions to return |
offset | UINTEGER | No | Number of versions to skip |
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 | UUID of this version |
version | UINTEGER | Version number (0-based) |
storage_url | VARCHAR | Storage URL of the version content |
description | VARCHAR | Version description or commit message |
created_at | TIMESTAMP WITH TIME ZONE | When this version was created |
api_version | UINTEGER | API 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.
Related
MD_GET_DIVE_VERSION— Retrieve a specific version including contentMD_UPDATE_DIVE_CONTENT— Create a new version