Version 4.0.24.18 (latest)
Create a SQL Runner Query
Either the connection_name
or model_name
parameter MUST be provided.
Request
POST
/sql_queries
Datatype
Description
Request
body
Expand HTTP Body definition...
body
SQL Runner Query
Expand SqlQueryCreate definition...
connection_name
Name of the db connection on which to run this query
connection_id
(DEPRECATED) Use `connection_name` instead
model_name
Name of LookML Model (this or `connection_id` required)
sql
SQL query
vis_config
Visualization configuration properties. These properties are typically opaque and differ based on the type of visualization used. There is no specified set of allowed keys. The values can be any type supported by JSON. A "type" key with a string value is often present, and is used by Looker to determine which visualization to present. Visualizations ignore unknown vis_config properties.
Response
200: SQL Runner Query
Datatype
Description
(object)
can
lock
Operations the current user is able to perform on this object
slug
lock
The identifier of the SQL query
last_runtime
lock
Number of seconds this query took to run the most recent time it was run
run_count
lock
Number of times this query has been run
browser_limit
lock
Maximum number of rows this query will display on the SQL Runner page
sql
lock
SQL query text
last_run_at
lock
The most recent time this query was run
connection
lock
Connection this query uses
Expand DBConnectionBase definition...
can
lock
Operations the current user is able to perform on this object
name
lock
Name of the connection. Also used as the unique identifier
dialect
lock
(Read-only) SQL Dialect details
Expand Dialect definition...
name
lock
The name of the dialect
label
lock
The human-readable label of the connection
supports_cost_estimate
lock
Whether the dialect supports query cost estimates
cost_estimate_style
lock
How the dialect handles cost estimation
persistent_table_indexes
lock
PDT index columns
persistent_table_sortkeys
lock
PDT sortkey columns
persistent_table_distkey
lock
PDT distkey column
supports_streaming
lock
Supports streaming results
automatically_run_sql_runner_snippets
lock
Should SQL Runner snippets automatically be run
connection_tests
supports_inducer
lock
Is supported with the inducer (i.e. generate from sql)
supports_multiple_databases
lock
Can multiple databases be accessed from a connection using this dialect
supports_persistent_derived_tables
lock
Whether the dialect supports allowing Looker to build persistent derived tables
has_ssl_support
lock
Does the database have client SSL support settable through the JDBC string explicitly?
snippets
Expand Snippet definition...
name
lock
Name of the snippet
label
lock
Label of the snippet
sql
lock
SQL text of the snippet
pdts_enabled
lock
True if PDTs are enabled on this connection
model_name
lock
Model name this query uses
creator
lock
User who created this SQL query
Expand UserPublic definition...
can
lock
Operations the current user is able to perform on this object
id
lock
Unique Id
first_name
lock
First Name
last_name
lock
Last Name
display_name
lock
Full name for display (available only if both first_name and last_name are set)
avatar_url
lock
URL for the avatar image (may be generic)
url
lock
Link to get this item
explore_url
lock
Explore page URL for this SQL query
plaintext
lock
Should this query be rendered as plain text
vis_config
Visualization configuration properties. These properties are typically opaque and differ based on the type of visualization used. There is no specified set of allowed keys. The values can be any type supported by JSON. A "type" key with a string value is often present, and is used by Looker to determine which visualization to present. Visualizations ignore unknown vis_config properties.
result_maker_id
ID of the ResultMakerLookup entry.
400: Bad Request
Datatype
Description
(object)
message
lock
Error details
documentation_url
lock
Documentation link
404: Not Found
Datatype
Description
(object)
message
lock
Error details
documentation_url
lock
Documentation link
409: Resource Already Exists
Datatype
Description
(object)
message
lock
Error details
documentation_url
lock
Documentation link
422: Validation Error
Datatype
Description
(object)
message
lock
Error details
errors
Expand ValidationErrorDetail definition...
field
lock
Field with error
code
lock
Error code
message
lock
Error info message
documentation_url
lock
Documentation link
documentation_url
lock
Documentation link
429: Too Many Requests
Datatype
Description
(object)
message
lock
Error details
documentation_url
lock
Documentation link
Examples
TypeScript