core.sql.execute_query
Execute a parameterized SQL query on an external database.
Secrets
Required secrets:sql: required valuesCONNECTION_URL.
Inputs
string
required
SQL query to execute. Use :param_name syntax for bound parameters. Do NOT use Tracecat expressions in the query string.
object | null
Bound query parameters as a dictionary (injected with :param_name syntax). Supply dynamic values here, NOT within the query string. This is required for safe, parameterized SQL queries.Default:
null.boolean
Return a single row instead of a list of rows. Defaults to False, which fetches all rows.Default:
false.integer
Maximum number of rows to return. Default 200. Prevents accidentally returning huge result sets.Default:
200.Examples
Query an external databasecore.duckdb.execute_sql
Execute SQL in an in-process DuckDB engine
Secrets
Optional secrets:amazon_s3: optional valuesAWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,AWS_SESSION_TOKEN,AWS_REGION,AWS_ROLE_ARN,AWS_ROLE_SESSION_NAME.
Inputs
string
required
SQL to execute in an in-process DuckDB connection.
integer | null
Duration of the chained role session in seconds (900-3600). AWS limits role chaining to a maximum of one hour. Only used together with role_arn.Default:
null.string | null
External ID required by the chained role’s trust policy, if any. Only used together with role_arn.Default:
null.string | null
AWS region of the S3 buckets this query reads. Overrides the AWS_REGION secret for the DuckDB S3 secret.Default:
null.string | null
ARN of an IAM role to assume (role chaining) with the credentials from the AWS secret before calling the service, e.g. a role in another AWS account that trusts the configured role or user. Requires sts:AssumeRole on that role.Default:
null.string | null
Session name recorded in CloudTrail for the chained AssumeRole. Defaults to a Tracecat workspace/run derived name.Default:
null.