Skip to main content

Start to Execute Sql in the background

/api/SqlBackground

StartQuery

Allow for starting a potentially long running query and getting back an immediate response with how to

  • fetch the data in various formats (if available, or if not simply being informed it is not yet ready)
  • view progress information (up until this point)
  • cancel the query (if still running) / clear the data (if already returned)

This can still error on things like an outright syntax error, but more runtime errors (e.g. from providers) will not cause this to error (that will happen when attempting to fetch data)

Here is an example that intentionally takes one minute to run:

select Str, Takes500Ms from Testing1K where UseLinq = true and [Int] <= 120

This is the only place in the Luminesce WebAPI where the following is supported. This will allow for the same user running a character-identical query not kick off a new query but simply be returned a reference to the already running one for up to N seconds (where N should be <= keepForSeconds).

The following error codes are to be anticipated with standard Problem Detail reports:

  • 400 BadRequest - there was something wrong with your query syntax (the issue was detected at parse-time)
  • 401 Unauthorized
  • 403 Forbidden