Skip to main content
Version: Next

Exec Transaction Of Raw Sql

Execute a pre-defined bunch of queries in the gateway

Description

Execute a bunch of queries provided in the parameters, in a transaction. Give the body in the request as argument. Returns the result of the queries against the specified database.

Example of body:

[
{
"query": "SELECT * FROM t1"
},
{
"query": "UPDATE t2 SET p1 = :a, p2 = :b WHERE id = :id",
"bindings": {
"id": "1234",
"a": "foo",
"b": "bar"
}
}
]

Inputs

  • Control Flow (Control Flow)
  • DB Config ID (String): The id of the database which is supposed to receive the query
  • Body (Object): Request body. Should contain objects with "query" (string) and ""bindings" (object) properties: an object containing the value that needs to be added to the query, corresponding to a named template. Templates are ":bindingName" for values, ":bindingName:" for identifiers. Should be an array or a JSON string convertable to an array.

Outputs

  • Result (Array): Rows array of json column named with row values.
  • Error Flow (Error Flow): Error if the execution of stored query fails
  • Control Flow (Control Flow)