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.
def to_h -> Hash[Symbol, Object]
The fields as a Hash, by name.
def name -> Symbol
The column's name, which is also its getter's.
def sql -> String
Its SQL type (bigint, double precision, text, boolean,
timestamptz, bytea).
def type -> Type[Object]
def null -> Bool
Whether it admits NULL: its getter then returns T?.
def primary -> Bool
Whether it is the primary key.
def default -> Int | Float | String | Bool | Time | Bytes | Nil
The value a model made with new starts with, or nil for none.
def redact -> Bool
Whether its value is hidden from inspect (a password, a token):
**redacted** shows instead.