List constraints
list_constraintsRetrieve all constraints (primary key, foreign key, unique, check, exclusion) for a table. Pass schema and table names; set fresh=true to bypass cache and read live after schema changes.
Instructions
List a table's constraints — primary/foreign keys, unique, check, exclusion. Set fresh=true to bypass the cache and re-read live (e.g. after a schema change). Returns a list of objects with name, type, and definition (the constraint SQL).
Example: list_constraints(schema='public', table='orders')
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fresh | No | ||
| table | Yes | ||
| schema | Yes | ||
| database | No | Optional: target a configured secondary (read-only) database by name; omit for the primary. Call list_databases to see the configured ids. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |