Fey::Column - Represents a column


version 0.43


  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:

  • 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 nullable.

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









Returns the specified attribute.


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



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


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.


See Fey for details on how to report bugs.


Dave Rolsky <>


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

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)