Dave Rolsky > Fey > Fey::Column

Download:
Fey-0.40.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  3
Open  2
View/Report Bugs
Module Version: 0.40   Source  

NAME ^

Fey::Column - Represents a column

VERSION ^

version 0.40

SYNOPSIS ^

  my $column = Fey::Column->new( name              => 'user_id',
                                 type              => 'integer',
                                 is_auto_increment => 1,
                               );

DESCRIPTION ^

This class represents a column in a table.

METHODS ^

This class provides the following methods:

Fey::Column->new()

This method constructs a new Fey::Column object. It takes the following parameters:

$column->name()

$column->type()

$column->generic_type()

$column->length()

$column->precision()

$column->is_auto_increment()

$column->is_nullable()

$column->default()

Returns the specified attribute.

$column->table()

Returns the Fey::Table object to which the column belongs, if any.

$column->alias(%p)

$column->alias($alias_name)

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().

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().

$column->is_alias()

Always returns false.

$column->sql()

$column->sql_with_alias()

$column->sql_or_alias()

Returns the appropriate SQL snippet for the column.

$column->id()

Returns a unique identifier for the column.

ROLES ^

This class does the Fey::Role::ColumnLike, Fey::Role::MakesAliasObjects, and Fey::Role::Named roles.

BUGS ^

See Fey for details on how to report bugs.

AUTHOR ^

Dave Rolsky <autarch@urth.org>

COPYRIGHT AND LICENSE ^

This software is Copyright (c) 2011 by Dave Rolsky.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)
syntax highlighting: