LLMs to turn Ad Hoc Questions into Real-Time AnswersRegister

Skip to main content

MD_UPDATE_DIVE_CONTENT

Public Preview

Dives are currently in public preview and functionality is subject to change.

Updates the content of an existing Dive, creating a new version. Each call increments the version number. Previous versions remain accessible via MD_GET_DIVE_VERSION.

Syntax

SELECT * FROM MD_UPDATE_DIVE_CONTENT(
id ='your-dive-uuid'::UUID,
content ='<updated JSX component code>'
);

Parameters

ParameterTypeRequiredDescription
idUUIDYesThe unique identifier of the Dive to update
contentVARCHARYesThe new JSX/React component code
descriptionVARCHARNoVersion description or commit message
api_versionUINTEGERNoAPI version for the Dive format. Defaults to 1.

Return Columns

ColumnTypeDescription
idUUIDUUID of the new version (not the Dive UUID)
versionUINTEGERNew version number (0-based)
storage_urlVARCHARStorage URL of the version content
descriptionVARCHARVersion description
created_atTIMESTAMP WITH TIME ZONEWhen this version was created
api_versionUINTEGERAPI version used

Examples

Update a Dive's content:

SELECT version, created_at
FROM MD_UPDATE_DIVE_CONTENT(
id ='a1b2c3d4-e5f6-7890-abcd-ef1234567890'::UUID,
content ='<updated component code>'
);

Update with a version description:

SELECT *
FROM MD_UPDATE_DIVE_CONTENT(
id ='a1b2c3d4-e5f6-7890-abcd-ef1234567890'::UUID,
content ='<updated component code>',
description ='Added region filter'
);

Errors

Returns an error if the Dive does not exist.