Skip to main content

statements

Creates, updates, deletes, gets or lists a statements resource.

Overview

Namestatements
TypeResource
Idconfluent.sql.statements

Fields

NameDatatypeDescription
namestringThe user provided name of the resource, unique within this environment.
_specobject
api_versionstringAPIVersion defines the schema version of this representation of a resource.
environment_idstringThe unique identifier for the environment.
kindstringKind defines the object this REST resource represents.
metadata``The metadata of the statement.
organization_idstringThe unique identifier for the organization.
resultobjectStatement Result represents a resource used to model results of SQL statements. The API allows you to read your SQL statement result.
specobjectThe specs of the Statement
statusobjectThe status of the Statement

Methods

NameAccessible byRequired ParamsDescription
get_sqlv1statementSELECTenvironment_id, organization_id, statement_nameGeneral Availability Make a request to read a statement.
list_sqlv1statementsSELECTenvironment_id, organization_idGeneral Availability Retrieve a sorted, filtered, paginated list of all statements.
create_sqlv1statementINSERTenvironment_id, organization_idGeneral Availability Make a request to create a statement.
delete_sqlv1statementDELETEenvironment_id, organization_id, statement_nameGeneral Availability Make a request to delete a statement.
patch_sqlv1statementUPDATEenvironment_id, organization_id, statement_nameEarly Access Make a request to patch a statement.
update_sqlv1statementEXECenvironment_id, organization_id, statement_nameGeneral Availability Make a request to update a statement. The request will fail with a 409 Conflict error if the Statement has changed since it was fetched. In this case, do a GET, reapply the modifications, and try the update again.

SELECT examples

General Availability Retrieve a sorted, filtered, paginated list of all statements.

SELECT
name,
_spec,
api_version,
environment_id,
kind,
metadata,
organization_id,
result,
spec,
status
FROM confluent.sql.statements
WHERE environment_id = '{{ environment_id }}'
AND organization_id = '{{ organization_id }}';

INSERT example

Use the following StackQL query and manifest file to create a new statements resource.

/*+ create */
INSERT INTO confluent.sql.statements (
data__name,
data__organization_id,
data__environment_id,
data__spec,
data__result,
environment_id,
organization_id
)
SELECT
'{{ name }}',
'{{ organization_id }}',
'{{ environment_id }}',
'{{ spec }}',
'{{ result }}'
;

UPDATE example

Updates a statements resource.

/*+ update */
UPDATE confluent.sql.statements
SET

WHERE
environment_id = '{{ environment_id }}'
AND organization_id = '{{ organization_id }}'
AND statement_name = '{{ statement_name }}';

DELETE example

Deletes the specified statements resource.

/*+ delete */
DELETE FROM confluent.sql.statements
WHERE environment_id = '{{ environment_id }}'
AND organization_id = '{{ organization_id }}'
AND statement_name = '{{ statement_name }}';