Skip to main content

tables_maintenance_configs

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

Overview

Nametables_maintenance_configs
TypeResource
Idcloudflare.r2_data_catalog.tables_maintenance_configs

Fields

The following fields are returned by SELECT queries:

Table maintenance configuration retrieved successfully.

NameDatatypeDescription
maintenance_configobjectConfigures maintenance for the table.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_by_accountselectaccount_id, bucket_name, namespace, table_nameRetrieve the maintenance configuration for a specific table, including compaction settings.
update_by_accountinsertaccount_id, bucket_name, namespace, table_nameUpdate the maintenance configuration for a specific table. This allows you to enable or disable compaction and adjust target file sizes for optimization.

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
account_idstringThe Cloudflare account ID.
bucket_namestringThe R2 bucket name.
namespacestringThe namespace identifier (use %1F as separator for nested namespaces).
table_namestringThe table name.

SELECT examples

Retrieve the maintenance configuration for a specific table, including compaction settings.

SELECT
maintenance_config
FROM cloudflare.r2_data_catalog.tables_maintenance_configs
WHERE account_id = '{{ account_id }}' -- required
AND bucket_name = '{{ bucket_name }}' -- required
AND namespace = '{{ namespace }}' -- required
AND table_name = '{{ table_name }}' -- required
;

INSERT examples

Update the maintenance configuration for a specific table. This allows you to enable or disable compaction and adjust target file sizes for optimization.

INSERT INTO cloudflare.r2_data_catalog.tables_maintenance_configs (
compaction,
snapshot_expiration,
account_id,
bucket_name,
namespace,
table_name
)
SELECT
'{{ compaction }}',
'{{ snapshot_expiration }}',
'{{ account_id }}',
'{{ bucket_name }}',
'{{ namespace }}',
'{{ table_name }}'
RETURNING
errors,
messages,
result,
success
;