Create Row
db_createInsert a new row into a PostgreSQL table with live schema validation, automatic stripping of sensitive columns, and an optional dry-run mode to preview before writing.
Instructions
Inserts a new row into the specified table. All columns are validated against the live schema before execution — typos in column names or type mismatches are caught early. Sensitive columns (passwords, tokens, API keys, etc.) are automatically stripped from the input to prevent accidental credential storage. Use dry_run=true to preview the insert without actually writing to the database.
When to use:
"Add a new user named Jane with email jane@example.com"
"Create an order for customer 42 with total $99.99"
Any single-row INSERT operation
Parameter guidance:
table: the target table name (required)
data: JSON object of column-value pairs to insert (required). Example: {"name": "Jane Doe", "email": "jane@example.com", "role": "admin"}
dry_run: set to true to validate without writing (default: false)
Behavioral notes:
The table name and all column names are validated against the live schema.
The INSERT runs in a transaction — if any constraint is violated, the entire operation rolls back with a clear error message.
On success, returns the inserted row including any auto-generated values (e.g., id).
Sensitive columns in the input are silently stripped before execution.
For multiple inserts, call this tool once per row or use db_raw_query with an INSERT ... VALUES statement (requires confirmed=true and ALLOW_RAW_WRITES).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | JSON object of column values to insert | |
| table | Yes | Name of the table to query | |
| dryRun | No | If true, simulates without writing | |
| database | No | Name of the database to query (from pgautopilot.json). Omit to use the current default database. |