Skip to content

Build a binding from local (uncommitted) SQL for `vite dev`

POST
/api/workspaces/{workspaceId}/apps/{id}/bindings/{name}/dev-build
curl --request POST \
--url http://localhost:8080/api/workspaces/example/apps/example/bindings/example/dev-build \
--header 'Content-Type: application/json' \
--cookie auth_session=<auth_session> \
--data '{ "source": "example", "dbtEnvironment": "example", "dbtDefer": true, "refresh": true, "async": true }'

The laptop dev loop behind makoData(): send the local bindings/<name>.sql text and get back the parquet of exactly that query, run read-only through the workspace connection its front matter names. The text is the whole input: no sandbox and (for a caller with edit access) no repo state is read, so a binding that exists only in the local checkout builds. Text whose content-addressed build is already stored (the published binding) is served from that artifact; anything else — an edit, a new binding, a refresh, or dbtEnvironment rendering {{ dbt_schema }} against a dev dbt environment (per relation: ones the environment has not built read prod, unless dbtDefer: false) — is a draft: built and streamed back, reused for 30 minutes (same connection + rendered SQL) unless refresh, never stored as the app’s artifact, so published viewers never see it. A draft that keeps failing answers 503 with Retry-After instead of re-running. May redirect to a short-lived signed artifact URL; follow redirects. With async: true, a build (not a stored artifact) answers 202 with a jobId to poll at GET …/binding-jobs/{jobId} instead.

workspaceId
required
string
id
required
string
name
required
string
Media typeapplication/json
object
source
required
string
>= 1 characters <= 524288 characters
dbtEnvironment
string
>= 1 characters <= 64 characters
dbtDefer
boolean
refresh
boolean
async
boolean

Example generated

{
"source": "example",
"dbtEnvironment": "example",
"dbtDefer": true,
"refresh": true,
"async": true
}

Redirect to a short-lived signed artifact URL

Successful response

Media typeapplication/json
object
success

Whether the request succeeded.

boolean
data

Endpoint-specific response payload.

message
string
error
string

Example

{
"message": "Operation completed",
"error": "Error message"
}

Invalid request

Media typeapplication/json
object
success
boolean
error
string

Example

{
"error": "Error message"
}

Internal server error

Media typeapplication/json
object
success
boolean
error
string

Example

{
"error": "Error message"
}