Skip to main content

statements

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

Overview

Namestatements
TypeResource
Idconfluent.sql.statements

Fields

The following fields are returned by SELECT queries:

Statement.

NameDatatypeDescription
namestringThe user provided name of the resource, unique within this environment. (example: sql123, pattern: [a-z0-9]([-a-z0-9][a-z0-9])?(.[a-z0-9]([-a-z0-9][a-z0-9])?)*)
environment_idstringThe unique identifier for the environment.
organization_idstring (uuid)The unique identifier for the organization.
api_versionstringAPIVersion defines the schema version of this representation of a resource. (sql/v1) (example: sql/v1)
kindstringKind defines the object this REST resource represents. (Statement)
metadataobjectThe metadata of the statement.
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

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_sqlv1_statementselectorganization_id, environment_id, statement_nameMake a request to read a statement.
list_sqlv1_statementsselectorganization_id, environment_idspec.compute_pool_id, page_size, page_token, label_selectorRetrieve a sorted, filtered, paginated list of all statements.
create_sqlv1_statementinsertorganization_id, environment_id, spec, nameMake a request to create a statement.
patch_sqlv1_statementupdateorganization_id, environment_id, statement_nameMake a request to patch a statement.
update_sqlv1_statementreplaceorganization_id, environment_id, statement_name, spec, name, metadataMake 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.
delete_sqlv1_statementdeleteorganization_id, environment_id, statement_nameMake a request to delete a statement.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
environment_idstringThe unique identifier for the environment.
organization_idstring (uuid)The unique identifier for the organization.
statement_namestringThe unique identifier for the statement.
label_selectorstringA comma-separated label selector to filter the statements.
page_sizeintegerA pagination size for collection requests.
page_tokenstringAn opaque pagination token for collection requests.
spec.compute_pool_idstringFilter the results by exact match for spec.compute_pool_id. When creating statements, if compute_pool_id is not specified, the statement will use the default compute pool. The default pool is automatically determined by the system. (example: lfcp-00000)

SELECT examples

Make a request to read a statement.

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

INSERT examples

Make a request to create a statement.

INSERT INTO confluent.sql.statements (
name,
organization_id,
environment_id,
spec,
result,
organization_id,
environment_id
)
SELECT
'{{ name }}' /* required */,
'{{ organization_id }}',
'{{ environment_id }}',
'{{ spec }}' /* required */,
'{{ result }}',
'{{ organization_id }}',
'{{ environment_id }}'
RETURNING
name,
environment_id,
organization_id,
api_version,
kind,
metadata,
result,
spec,
status
;

UPDATE examples

Make a request to patch a statement.

UPDATE confluent.sql.statements
SET
-- No updatable properties
WHERE
organization_id = '{{ organization_id }}' --required
AND environment_id = '{{ environment_id }}' --required
AND statement_name = '{{ statement_name }}' --required
RETURNING
name,
environment_id,
organization_id,
api_version,
kind,
metadata,
result,
spec,
status;

REPLACE examples

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.

REPLACE confluent.sql.statements
SET
name = '{{ name }}',
organization_id = '{{ organization_id }}',
environment_id = '{{ environment_id }}',
spec = '{{ spec }}',
result = '{{ result }}'
WHERE
organization_id = '{{ organization_id }}' --required
AND environment_id = '{{ environment_id }}' --required
AND statement_name = '{{ statement_name }}' --required
AND spec = '{{ spec }}' --required
AND name = '{{ name }}' --required;

DELETE examples

Make a request to delete a statement.

DELETE FROM confluent.sql.statements
WHERE organization_id = '{{ organization_id }}' --required
AND environment_id = '{{ environment_id }}' --required
AND statement_name = '{{ statement_name }}' --required
;