/workspace/templates/sql_table_insert

The sql_table_insert query template module allows to insert multiple records provided as a request POST body into a SQL table.

The POST body must contain properties for each field. The key will be split on :: to provide the field name and the cast for values in the values array.

{
  "letters::varchar": [
    "a",
    "b"
  ],
  "drop table (table)": [1,2], // Potential SQL Injection
  "numbers::int": [
    1,
    2
  ]
}

The field name and the cast must be SQL identifiers. Properties with other keys are skipped.

The values are substituted as query params. The params are assigned with a body_ prefix, so a body key can't overwrite a param of the template, eg. the table.

Members

(inner, constant) IDENTIFIER

Field names and casts [body key parts] must be SQL identifiers.