code_schema
code_schema reads your ORM schema files and returns table columns with their types. No live database connection required — it works from the indexed schema definitions.
code_schema()code_schema(table="users")code_schema(table="orders")Parameters
Section titled “Parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
table | string | — | Table name to look up; omit to list all tables |
Output
Section titled “Output”Table: users id uuid NOT NULL PRIMARY KEY email varchar(255) NOT NULL UNIQUE name varchar(100) NOT NULL created_at timestamp NOT NULL DEFAULT now() deleted_at timestamp NULL
Table: orders id uuid NOT NULL PRIMARY KEY user_id uuid NOT NULL FK → users.id total integer NOT NULL status order_status NOT NULL DEFAULT 'pending'Supported ORMs
Section titled “Supported ORMs”- Drizzle ORM
- Prisma
- TypeORM
When to use
Section titled “When to use”- Understand the shape of a table before writing a query
- Confirm column names and types when debugging type errors
- Review foreign key relationships between tables
- Onboarding — understand the data model without reading schema files manually