Skip to content
On this page

@codegen

Postgres Mysql (beta) Sqlite (beta)

Example

sql
-- @codegen.rename('ProductItem')
-- @codegen.type(id: 'branded')
CREATE TABLE products (
  id SERIAL PRIMARY KEY,
  name VARCHAR(100) NOT NULL,
  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