Describe table
describeInspect a table's columns, types, keys, defaults, foreign keys, indexes, and referencing tables before writing SQL.
Instructions
Show the structure of one known table: columns with type, nullability, key, default, foreign-key target (fk = table.column — use it to write JOINs) and comment, plus indexes and the tables that reference it. Use it before writing SQL against a table; use search_schema if you don't know the table name yet. Returns table, sql_name (properly quoted name for SQL), columns[N]{name,type,nullable,key,default,fk,comment}, indexes[N]{name,unique,columns} and referenced_by[N]{table,column,ref_column}. On failure returns isError with 'error: ' (e.g. refused statement, unknown table, SQL error).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | Table or view name as returned by `tables`. PostgreSQL tables outside `public` are written schema.table. | |
| database | No | Optional database to use instead of the connection's default (names from `databases`). Omit to use the default. | |
| connection | Yes | Connection name exactly as returned by `connections` (e.g. "shop"). Unknown or unexposed names return an error. |