sql-views
GET
https://lucida.15-204-158-166.sslip.io /v1/projects/{project_id}/sql-views Parameters
project_idstringpathrequiredstatusstringqueryneeds_attention: failing or suspended views only
Code samples
cURL
curl -X GET "https://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/sql-views"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 Page of ViewOut, by name
400
404
POST
https://lucida.15-204-158-166.sslip.io /v1/projects/{project_id}/sql-views Parameters
project_idstringpathrequiredRequest body
application/json
descriptionstringmaterializedbooleannamestringrequiredLowercase letters, digits and underscores, starting with a letter. Becomes the table name.
querystringrequiredOne LQL SELECT.
refresh_minutesintegerMinutes between scheduled refreshes (5 to 10080); materialized views only.
{
"description": "string",
"materialized": true,
"name": "string",
"query": "string",
"refresh_minutes": 0
}Code samples
cURL
curl -X POST "https://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/sql-views" \
-H "Content-Type: application/json" \
-d '{"description":"string","materialized":true,"name":"string","query":"string","refresh_minutes":0}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
201
Example
{
"block_on_failed_checks": true,
"consecutive_failures": 0,
"created_at": "2024-01-01T00:00:00Z",
"description": "string",
"id": "string",
"incremental_column": "string",
"incremental_lookback_minutes": 0,
"last_error": "string",
"materialized": true,
"name": "string",
"query": "string",
"refresh_minutes": 0,
"refreshed_at": "2024-01-01T00:00:00Z",
"snapshot_columns": [
"string"
],
"stored_columns": [
[
"string"
]
],
"stored_rows": 0,
"suspend_after": 0,
"suspend_reason": "string",
"suspended_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z",
"depends_on": [
"string"
]
}Schema
block_on_failed_checksbooleanrequiredA refresh whose error-severity checks fail is not published (write-audit-publish).
consecutive_failuresintegerrequiredFailed refreshes in a row (P-M22); a success resets it.
created_atstringrequireddescriptionstringrequiredidstringrequiredincremental_columnstringColumn a refresh appends past (incremental view); null = full refresh every time.
incremental_lookback_minutesintegerrequiredMinutes below the watermark an incremental refresh re-reads to pick up late rows (G255); 0 = none.
last_errorstringmaterializedbooleanrequirednamestringrequiredquerystringrequiredrefresh_minutesintegerMinutes between scheduled refreshes of a materialized view; null = manual only.
refreshed_atstringsnapshot_columnsarrayColumn names of the last snapshot.
stored_columnsarray[[name, type], ..] of the stored version.stored_rowsintegerRows of the published ClickHouse-stored version (no row cap).
suspend_afterintegerFailures in a row that suspend the schedule; null = the server default.
suspend_reasonstringsuspended_atstringSet when the schedule was suspended after repeated failures; resume clears it.
updated_atstringrequireddepends_onstring[]requiredTables and other views the query reads directly.
400 Bad name, schedule or query (incl. view cycles)
403
404
409
GET
https://lucida.15-204-158-166.sslip.io /v1/projects/{project_id}/sql-views/lineage Parameters
project_idstringpathrequiredviewstringqueryOnly this view and its transitive upstream and downstream
Code samples
cURL
curl -X GET "https://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/sql-views/lineage"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200
Example
{
"edges": [
{
"from": "string",
"to": "string"
}
],
"nodes": [
{
"downstream": [
"string"
],
"id": "string",
"kind": "string",
"materialized": true,
"needs_attention": true,
"refreshed_at": "2024-01-01T00:00:00Z",
"upstream": [
"string"
]
}
]
}Schema
edgesLineageEdge[]requiredShow child parameters
fromstringrequiredRead by
to.tostringrequirednodesLineageNode[]requiredShow child parameters
downstreamstring[]requiredEvery view that reads this one, directly or through other views.
idstringrequiredThe table or view name.
kindstringrequiredtable | view | missing (a name no table or view answers to).materializedbooleanrequiredneeds_attentionbooleanrequiredThe view failed its last refresh or is suspended (P-M22).
refreshed_atstringupstreamstring[]requiredEvery table and view this one reads, directly or through other views.
404
GET
https://lucida.15-204-158-166.sslip.io /v1/projects/{project_id}/sql-views/{id} Parameters
project_idstringpathrequiredidstringpathrequiredCode samples
cURL
curl -X GET "https://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/sql-views/{id}"TypeScript
Python
Go
PHP
Ruby
Java
DELETE
https://lucida.15-204-158-166.sslip.io /v1/projects/{project_id}/sql-views/{id} Parameters
project_idstringpathrequiredidstringpathrequiredCode samples
cURL
curl -X DELETE "https://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/sql-views/{id}"TypeScript
Python
Go
PHP
Ruby
Java
Responses
204
403
404
409 Other views read this one
PATCH
https://lucida.15-204-158-166.sslip.io /v1/projects/{project_id}/sql-views/{id} Parameters
project_idstringpathrequiredidstringpathrequiredRequest body
application/json
block_on_failed_checksbooleanKeep the published rows when an error-severity data-quality check on this view fails against a refresh (write-audit-publish). Default true.
descriptionstringincremental_columnstringColumn an incremental refresh appends past (rows whose value is above the last maximum);
null refreshes in full again. Changing it discards the stored rows.incremental_lookback_minutesintegerMinutes below the watermark an incremental refresh re-reads (0 to 10080, default 0) so rows that arrive late are picked up; rows already published are skipped by content. Needs a date or time incremental column.
materializedbooleanquerystringrefresh_minutesintegernull switches the schedule off; absent leaves it.suspend_afterintegerFailed refreshes in a row that suspend the schedule (1 to 100);
null = the server default (LC_SQL_VIEW_SUSPEND_AFTER, 3).{
"block_on_failed_checks": true,
"description": "string",
"incremental_column": "string",
"incremental_lookback_minutes": 0,
"materialized": true,
"query": "string",
"refresh_minutes": 0,
"suspend_after": 0
}Code samples
cURL
curl -X PATCH "https://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/sql-views/{id}" \
-H "Content-Type: application/json" \
-d '{"block_on_failed_checks":true,"description":"string","incremental_column":"string","incremental_lookback_minutes":0,"materialized":true,"query":"string","refresh_minutes":0,"suspend_after":0}'TypeScript
Python
Go
PHP
Ruby
Java
GET
https://lucida.15-204-158-166.sslip.io /v1/projects/{project_id}/sql-views/{id}/data Parameters
project_idstringpathrequiredidstringpathrequiredCode samples
cURL
curl -X GET "https://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/sql-views/{id}/data"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 The stored snapshot of a materialized view
Example
{
"columns": [
"string"
],
"refreshed_at": "2024-01-01T00:00:00Z",
"rows": [
[
{}
]
]
}Schema
columnsstring[]requiredrefreshed_atstringrowsobject[][]required404 No such view, or it has no snapshot yet
POST
https://lucida.15-204-158-166.sslip.io /v1/projects/{project_id}/sql-views/{id}/refresh Parameters
project_idstringpathrequiredidstringpathrequiredCode samples
cURL
curl -X POST "https://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/sql-views/{id}/refresh"TypeScript
Python
Go
PHP
Ruby
Java
POST
https://lucida.15-204-158-166.sslip.io /v1/projects/{project_id}/sql-views/{id}/resume Lift a suspension (P-M22): the failure streak resets and the view refreshes on the next tick.
Parameters
project_idstringpathrequiredidstringpathrequiredCode samples
cURL
curl -X POST "https://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/sql-views/{id}/resume"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200
Example
{
"block_on_failed_checks": true,
"consecutive_failures": 0,
"created_at": "2024-01-01T00:00:00Z",
"description": "string",
"id": "string",
"incremental_column": "string",
"incremental_lookback_minutes": 0,
"last_error": "string",
"materialized": true,
"name": "string",
"query": "string",
"refresh_minutes": 0,
"refreshed_at": "2024-01-01T00:00:00Z",
"snapshot_columns": [
"string"
],
"stored_columns": [
[
"string"
]
],
"stored_rows": 0,
"suspend_after": 0,
"suspend_reason": "string",
"suspended_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z"
}Schema
block_on_failed_checksbooleanrequiredA refresh whose error-severity checks fail is not published (write-audit-publish).
consecutive_failuresintegerrequiredFailed refreshes in a row (P-M22); a success resets it.
created_atstringrequireddescriptionstringrequiredidstringrequiredincremental_columnstringColumn a refresh appends past (incremental view); null = full refresh every time.
incremental_lookback_minutesintegerrequiredMinutes below the watermark an incremental refresh re-reads to pick up late rows (G255); 0 = none.
last_errorstringmaterializedbooleanrequirednamestringrequiredquerystringrequiredrefresh_minutesintegerMinutes between scheduled refreshes of a materialized view; null = manual only.
refreshed_atstringsnapshot_columnsarrayColumn names of the last snapshot.
stored_columnsarray[[name, type], ..] of the stored version.stored_rowsintegerRows of the published ClickHouse-stored version (no row cap).
suspend_afterintegerFailures in a row that suspend the schedule; null = the server default.
suspend_reasonstringsuspended_atstringSet when the schedule was suspended after repeated failures; resume clears it.
updated_atstringrequired403
404
Updated