Skip to content

class Athena::ORM::Schema::Column
inherits Reference #

Describes a database column, as passed to AORM::Types::Type#sql_declaration to build the SQL declaring it.

Todo

Nothing in the ORM generates schema yet, so the ORM itself never builds columns or calls AORM::Types::Type#sql_declaration.

Constructors#

.new(name : String, type : Types::Type)#

Creates a column named name, holding values of type.

View source

Methods#

#auto_increment=(auto_increment : Bool)#

Whether the database generates the column's value, e.g. an identity column.

View source

#auto_increment? : Bool#

Whether the database generates the column's value, e.g. an identity column.

View source

#fixed=(fixed : Bool)#

Whether a string or binary column has a fixed length.

View source

#fixed? : Bool#

Whether a string or binary column has a fixed length.

View source

#length : Int32 | ::Nil#

The maximum length of a string or binary column.

View source

#length=(length : Int32 | Nil)#

The maximum length of a string or binary column.

View source

#name : String#

Returns the name of the column.

View source

#precision : Int32 | ::Nil#

The total number of digits of a decimal column.

View source

#precision=(precision : Int32 | Nil)#

The total number of digits of a decimal column.

View source

#scale : Int32 | ::Nil#

The number of digits to the right of the decimal point of a decimal column.

View source

#scale=(scale : Int32 | Nil)#

The number of digits to the right of the decimal point of a decimal column.

View source

#type : Types::Type#

Returns the type of the column's values.

View source

#unsigned=(unsigned : Bool)#

Whether a numeric column is unsigned, on platforms supporting it.

View source

#unsigned? : Bool#

Whether a numeric column is unsigned, on platforms supporting it.

View source