insert_graph
Insert multiple table rows in a single payload, automatically resolving foreign key dependencies and parent IDs for relational database seeding.
Instructions
Seed mock, test, or relational data rows into the database. Supports inserting entries into multiple tables at the same time in a single payload.
When to use: This is the PREFERRED and recommended tool for inserting data records into the database. Use this instead of executing raw SQL INSERT statements. It handles table dependencies, resolves auto-generated parent IDs dynamically, and ensures safe transactions.
CRITICAL: The payload must map table names to a list of DICTIONARIES (not lists or arrays of values). Each dictionary must map column names to their values.
Example input payload: { "users": [ { "__temp_id": "u1", "name": "Alice Smith", "email": "alice@example.com" } ], "posts": [ { "title": "My First Post", "author_id": "ref:users:u1" } ] }
Args: payload: Dict mapping table name to a list of dict objects representing rows. Rows can specify "__temp_id" (e.g. "u1"). Foreign keys can refer to parents using "ref:parent_table:temp_id" (e.g. "ref:users:u1").
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| payload | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||