data Rotor::Column(name: Symbol, sql: String, type: Type[Object], null: Bool, primary: Bool, default: Int | Float | String | Bool | Time | Bytes | Nil, redact: Bool)

A column of a model's table, as its table block declares it.

/home/runner/work/rotor/rotor/src/column.qz:5

Methods

def with(*, name: Symbol = …, sql: String = …, type: Type[Object] = …, null: Bool = …, primary: Bool = …, default: Int | Float | String | Bool | Time | Bytes | Nil = …, redact: Bool = …) -> Rotor::Column

A copy with the fields given replaced.

/home/runner/work/rotor/rotor/src/column.qz:5

def to_h -> Hash[Symbol, Object]

The fields as a Hash, by name.

/home/runner/work/rotor/rotor/src/column.qz:5

def name -> Symbol

The column's name, which is also its getter's.

/home/runner/work/rotor/rotor/src/column.qz:7

def sql -> String

Its SQL type (bigint, double precision, text, boolean, timestamptz, bytea).

/home/runner/work/rotor/rotor/src/column.qz:10

def type -> Type[Object]

Its Quarz type: Int, Float, String, Bool, Time or Bytes.

/home/runner/work/rotor/rotor/src/column.qz:12

def null -> Bool

Whether it admits NULL: its getter then returns T?.

/home/runner/work/rotor/rotor/src/column.qz:14

def primary -> Bool

Whether it is the primary key.

/home/runner/work/rotor/rotor/src/column.qz:16

def default -> Int | Float | String | Bool | Time | Bytes | Nil

The value a model made with new starts with, or nil for none.

/home/runner/work/rotor/rotor/src/column.qz:18

def redact -> Bool

Whether its value is hidden from inspect (a password, a token): **redacted** shows instead.

/home/runner/work/rotor/rotor/src/column.qz:21