The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Data::HandyGen::mysql::ColumnDef - Manages one column definition

VERSION

This documentation refers to Data::HandyGen::mysql::ColumnDef version 0.0.5

SYNOPSIS

    use Data::HandyGen::mysql::ColumnDef;

    my $cd = Data::HandyGen::mysql::ColumnDef->new('colname', %column_definition);

    #  true if 'colname' is auto_increment
    my $res = $cd->is_auto_increment();

    #  get column type
    my $type = $cd->data_type();

CAUTION

This module is not intended for use outside Data::HandyGen. Its interface may be changed in the future.

DESCRIPTION

This class is a container of column definition retrieved from information_schema.columns.

METHODS

new($colname, %params)

Constructor.

%params is a hash which contains a column definition retrieved from information_schema.columns.

name()

Returns column name.

is_auto_increment()

Returns 1 if the column is auto_increment. Otherwise returns 0.

To retrieve other attributes

information_schema.columns has many attributes. You can retrieve one of them by using a method which name corresponds to attribute name in lowercase.

For example, you can retrieve 'DATA_TYPE' like this:

    $type = $column_def->data_type();

AUTHOR

Egawata

LICENCE AND COPYRIGHT

Copyright (c)2013-2014 Egawata All rights reserved.

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

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.