struct

Ralph::Schema::DatabaseColumn

Inherits Struct / Value / Object

Represents a database column as it exists in the actual database

Constructors

new(name : String, type : String, nullable : Bool, default : String | Nil, primary_key : Bool, auto_increment : Bool)
Source

Instance methods

auto_increment

Whether this column auto-increments (SERIAL, AUTOINCREMENT, etc.)

clone
Source
copy_with(name _name = @name, type _type = @type, nullable _nullable = @nullable, default _default = @default, primary_key _primary_key = @primary_key, auto_increment _auto_increment = @auto_increment)
Source
default

Default value expression as a string (e.g., "0", "'active'", "now()")

name

Column name

nullable

Whether the column allows NULL values

primary_key

Whether this column is part of the primary key

type

Raw SQL type (e.g., "VARCHAR(255)", "BIGINT", "integer")