NAME

DBIx::QuickORM::Schema::Table::Column - Metadata for a single table column.

DESCRIPTION

Holds the schema metadata for one column: its name, ordinal position, nullability, identity flag, defaults, type, and storage affinity. The affinity is resolved lazily from an explicit value, a scalar-ref type name, or a type object, and cached.

User-provided columns and introspected columns can be combined with merge, where the other column's values win.

SYNOPSIS

my $col = DBIx::QuickORM::Schema::Table::Column->new(
    name  => 'id',
    order => 1,
    type  => \'integer',
);

my $affinity = $col->affinity;

ATTRIBUTES

name

The column name.

sql_default

The column's SQL-level default.

perl_default

A Perl-side default value or generator.

omit

True if the column should be omitted from default fetches.

order

The column's ordinal position in the table.

nullable

True if the column accepts NULL.

identity

True if the column is an identity / auto-increment column.

affinity

Storage affinity; resolved from type on demand if not given.

type

The column type: a scalar ref naming a SQL type, or a type object.

created

Human-readable note of where the column was defined.

compiled

Cached compiled form of the column.

PUBLIC METHODS

$name = $col->name

The column name.

$affinity = $col->affinity($dialect)

Return the column's storage affinity, resolving and caching it from the type when not set explicitly. Croaks when no affinity is set and none can be derived from the type.

$col = $col->merge($other, %params)

Return a new column combining this column with another (and any extra params), where the other column's values and the params win.

$copy = $col->clone(%params)

Return a copy of this column with any passed params overriding its values.

SOURCE

The source code repository for DBIx::QuickORM can be found at https://github.com/exodist/DBIx-QuickORM.

MAINTAINERS

Chad Granum <exodist@cpan.org>

AUTHORS

Chad Granum <exodist@cpan.org>

COPYRIGHT

Copyright Chad Granum <exodist7@gmail.com>.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See https://dev.perl.org/licenses/