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