data
Execute PostgreSQL database operations including insert, update, delete, and bulk actions with data validation for efficient table management.
Instructions
Data operations: insert, update, delete, bulk operations with validation
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Action: insert (single row), update (modify rows), delete (remove rows), bulk_insert (multiple rows), bulk_update (batch update), truncate (empty table) | |
| data | No | Data object for insert/update (key-value pairs) | |
| options | No | Operation options | |
| rows | No | Array of data objects for bulk operations | |
| schemaName | No | Schema name (default: public) | public |
| tableName | Yes | Table name (required for all actions) | |
| where | No | WHERE conditions for update/delete operations |
Input Schema (JSON Schema)
{
"properties": {
"action": {
"description": "Action: insert (single row), update (modify rows), delete (remove rows), bulk_insert (multiple rows), bulk_update (batch update), truncate (empty table)",
"enum": [
"insert",
"update",
"delete",
"bulk_insert",
"bulk_update",
"truncate"
],
"type": "string"
},
"data": {
"description": "Data object for insert/update (key-value pairs)",
"type": "object"
},
"options": {
"description": "Operation options",
"properties": {
"onConflict": {
"description": "ON CONFLICT action (DO NOTHING, DO UPDATE)",
"type": "string"
},
"returning": {
"description": "Columns to return",
"items": {
"type": "string"
},
"type": "array"
},
"validate": {
"default": true,
"description": "Validate data before operation",
"type": "boolean"
}
},
"type": "object"
},
"rows": {
"description": "Array of data objects for bulk operations",
"items": {
"type": "object"
},
"type": "array"
},
"schemaName": {
"default": "public",
"description": "Schema name (default: public)",
"type": "string"
},
"tableName": {
"description": "Table name (required for all actions)",
"type": "string"
},
"where": {
"description": "WHERE conditions for update/delete operations",
"type": "object"
}
},
"required": [
"action",
"tableName"
],
"type": "object"
}