insert-data
Insert single or multiple records into a PostgreSQL table, with options for conflict resolution (ignore/update) and returning inserted data. Simplify database operations securely.
Instructions
Insert new records into a table. Supports single or multiple records, conflict resolution (ignore/update), and returning inserted data.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
conflict_columns | No | ||
data | Yes | ||
on_conflict | No | error | |
returning | No | ||
table | Yes |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"conflict_columns": {
"items": {
"type": "string"
},
"type": "array"
},
"data": {
"anyOf": [
{
"additionalProperties": {},
"type": "object"
},
{
"items": {
"additionalProperties": {},
"type": "object"
},
"type": "array"
}
]
},
"on_conflict": {
"default": "error",
"enum": [
"error",
"ignore",
"update"
],
"type": "string"
},
"returning": {
"default": [
"*"
],
"items": {
"type": "string"
},
"type": "array"
},
"table": {
"minLength": 1,
"type": "string"
}
},
"required": [
"table",
"data"
],
"type": "object"
}