Fey::Column - Represents a column
my $column = Fey::Column->new( name => 'user_id', type => 'integer', is_auto_increment => 1, );
This class represents a column in a table.
This class provides the following methods:
This method constructs a new Fey::Column object. It takes the following parameters:
Fey::Column
name - required
The name of the column.
type - required
The type of the column. This should be a string. Do not include modifiers like length or precision.
generic_type - optional
This should be one of the following types:
text
blob
integer
float
date
datetime
time
boolean
other
This indicate a generic type for the column, which is intended to allow for a common description of column types across different DBMS platforms.
If this parameter is not specified, then the constructor code will attempt to determine a reasonable value, defaulting to "other" if necessary.
length - optional
The length of the column. This must be a positive integer.
precision - optional
The precision of the column, for float-type columns. This must be an integer >= 0.
is_auto_increment - defaults to 0
This indicates whether or not the column is auto-incremented.
is_nullable - defaults to 0
A boolean indicating whether the column is nullab.e
default - optional
This must be either a scalar (including undef) or a Fey::Literal object. If a scalar is provided, it is turned into a Fey::Literal object via Fey::Literal->new_from_scalar().
Fey::Literal
Fey::Literal->new_from_scalar()
Returns the specified attribute.
Returns the Fey::Table object to which the column belongs, if any.
Fey::Table
This method returns a new Fey::Column::Alias object based on the column. Any parameters passed to this method will be passed through to Fey::Column::Alias->new().
Fey::Column::Alias
Fey::Column::Alias->new()
As a shortcut, if you pass a single argument to this method, it will be passed as the "alias_name" parameter to Fey::Table::Column->new().
Fey::Table::Column->new()
Always returns false.
Returns the appropriate SQL snippet for the column.
Returns a unique identifier for the column.
This class does the Fey::Role::ColumnLike, Fey::Role::MakesAliasObjects, and Fey::Role::Named roles.
Dave Rolsky, <autarch@urth.org>
See Fey for details on how to report bugs.
Copyright 2006-2009 Dave Rolsky, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Fey, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Fey
CPAN shell
perl -MCPAN -e shell install Fey
For more information on module installation, please visit the detailed CPAN module installation guide.