Skip to content

Latest commit

 

History

History
26 lines (23 loc) · 1.03 KB

sync_async.md

File metadata and controls

26 lines (23 loc) · 1.03 KB

Syncronous and Asynchronous Operations

StackQL mutation operations sucn as INSERT, UPDATE, DELETE and [EXEC](https://stackql.io/docs/language-spec/exec are asyncronous and non-blocking by default (if this is implemented by the provider). This behavior can be changed by using the /*+ AWAIT */ query hint. For example, to perform a synchronous INSERT operation, run the following:

INSERT /*+ AWAIT */ INTO google.compute.disks(
  project,
  zone,
  data__name,
  data__sizeGb
)
SELECT
  'stackql-demo',
  'australia-southeast1-a',
  'test-disk-1',
  '512'
;

Progress information will be returned as the operation progresses. For example:

compute#operation: insert in progress, 10 seconds elapsed                                                                         
compute#operation: insert in progress, 20 seconds elapsed
compute#operation: insert in progress, 30 seconds elapsed
compute#operation: insert complete