
Databricks Lakebase Query
CertifiedRun a SQL query on Databricks Lakebase
Databricks Lakebase Query
Run a SQL query on Databricks Lakebase
Mints a short-lived OAuth database credential via the Databricks SDK, then executes a single SQL statement against Lakebase over the Postgres wire protocol. Use fetchType to control how rows are returned: FETCH (all rows in memory), FETCH_ONE (first row), STORE (Ion file in internal storage), or NONE (execute only).
type: io.kestra.plugin.databricks.lakebase.QueryExamples
Run a query against a Lakebase database
id: lakebase_query
namespace: company.team
tasks:
- id: query_orders
type: io.kestra.plugin.databricks.lakebase.Query
workspaceHost: "{{ secret('DATABRICKS_HOST') }}"
clientId: "{{ secret('DATABRICKS_CLIENT_ID') }}"
clientSecret: "{{ secret('DATABRICKS_CLIENT_SECRET') }}"
endpoint: "{{ secret('LAKEBASE_ENDPOINT_NAME') }}"
database: "orders_db"
sql: "SELECT id, status, updated_at FROM orders WHERE status = 'pending'"
fetchType: FETCH
Properties
clientId *string
OAuth M2M client ID
Service principal client ID (UUID). Also used as the Postgres username when connecting to Lakebase.
clientSecret *string
OAuth M2M client secret
Service principal OAuth secret used to mint a short-lived Lakebase database credential. Render from secrets.
database *string
Postgres database name
Database to open after authentication, e.g. databricks_postgres or orders_db
endpoint *string
Lakebase endpoint resource name
Passed to generateDatabaseCredential. Format: projects/
sql *string
SQL query to execute
Single SQL statement rendered with flow variables before execution
workspaceHost *string
Databricks workspace host
Workspace URL used by the Databricks SDK to mint a Lakebase database credential, e.g. https://
afterSQL string
SQL to execute after the main query in the same transaction
Optional single statement, useful for marking processed rows. Committed together with the main query.
assets
Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.
io.kestra.core.models.assets.AssetsDeclaration
IGNOREFAILWARNAsset failure behavior
Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.
Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.
The assets consumed as inputs.
io.kestra.core.models.assets.AssetIdentifier
1The assets produced as outputs.
io.kestra.plugin.ee.assets.Dataset
1150{}1150io.kestra.plugin.ee.assets.File
1150{}1150io.kestra.plugin.ee.assets.Table
1150{}1150io.kestra.plugin.ee.assets.VM
1150{}1150io.kestra.core.models.assets.External
1150{}1150io.kestra.core.models.assets.Custom
11501Custom asset type
{}1150fetchSize integerstring
10000JDBC fetch size for STORE mode
Number of rows fetched per database round trip when fetchType is STORE. Default: 10000
fetchType string
FETCHSTOREFETCHFETCH_ONENONEResult fetching mode
FETCH returns all rows, FETCH_ONE returns the first row only, STORE streams rows to internal storage (Ion), NONE returns no data. Default: FETCH
host string
Lakebase Postgres hostname
Optional. When omitted, the hostname is resolved from the endpoint via the Databricks Postgres API (status.hosts.host).
parameters object
Named parameter bindings
Map of parameter names to values. Use : name placeholders in SQL; they are replaced with JDBC ? bindings.
port integerstring
5432Lakebase Postgres port
Defaults to 5432
ssl booleanstring
trueEnable SSL
Lakebase requires SSL. Defaults to true.
sslCert string
SSL client certificate
PEM-encoded client certificate written to a temp file and passed to the Postgres driver as sslcert
sslKey string
SSL client key
PEM-encoded client key written to a temp file and passed to the Postgres driver as sslkey
sslKeyPassword string
SSL client key password
sslMode string
REQUIREDISABLEALLOWPREFERREQUIREVERIFY_CAVERIFY_FULLSSL mode
Postgres sslmode. Defaults to REQUIRE, which is the Lakebase-recommended setting.
sslRootCert string
SSL root certificate
PEM-encoded CA certificate written to a temp file and passed to the Postgres driver as sslrootcert
timeZoneId string
Time zone for temporal values
Timezone used when converting date/time columns; defaults to the worker JVM time zone
Outputs
row object
First fetched row
Present when fetchType is FETCH_ONE
rows array
Fetched rows
Present when fetchType is FETCH
size integer
Number of fetched rows
uri string
uriResult file URI
Internal storage URI of the Ion file when fetchType is STORE
Metrics
fetch.size counter
Query result size