Skip to content
On this page

@codegen

Project-level template execution for generated code and typed artifacts

Postgres Mysql (beta) Sqlite (beta) Mssql

Example

Shape generated code

These tags affect template output rather than emitted SQL.

sql
-- @codegen.rename('ProductItem')
CREATE TABLE products (
  -- @codegen.type('Money')
  price NUMERIC(10,2),
  -- @codegen.skip
  internal_notes TEXT
);

Tags

@codegen.rename

Rename table/column in generated code (optional second arg scopes to a specific template)

Targets: table, column, view

Arguments:Positional: string, string

@codegen.skip

Exclude from generated code (optional arg scopes to a specific template)

Targets: table, column, view

Arguments:Positional: string

@codegen.type

Override generated type for a column (optional second arg scopes to a specific template)

Targets: column

Arguments:Positional: string, string