NAME
DBIx::DBSchema::Column - Column objects
SYNOPSIS
use DBIx::DBSchema::Column;
$column = new DBIx::DBSchema::Column ( $name, $sql_type, '' );
$column = new DBIx::DBSchema::Column ( $name, $sql_type, 'NULL' );
$column = new DBIx::DBSchema::Column ( $name, $sql_type, '', $length );
$column = new DBIx::DBSchema::Column ( $name, $sql_type, 'NULL', $length );
$column = new DBIx::DBSchema::Column ( $name, $sql_type, 'NULL', $length, $local );
$name = $column->name;
$column->name( 'name' );
$sql_type = $column->type;
$column->sql_type( 'sql_type' );
$null = $column->null;
$column->null( 'NULL' );
$column->null( 'NOT NULL' );
$column->null( '' );
$length = $column->length;
$column->length( '10' );
$column->length( '8,2' );
$sql_line = $column->line;
$sql_line = $column->line($datasrc);
DESCRIPTION
DBIx::DBSchema::Column objects represent columns in tables (see DBIx::DBSchema::Table).
METHODS
- new [ NAME [ , SQL_TYPE [ , NULL [ , LENGTH [ , LOCAL ] ] ] ] ]
-
Creates a new DBIx::DBSchema::Column object. NAME is the name of the column. SQL_TYPE is the SQL data type. NULL is the nullability of the column (the empty string is equivalent to `NOT NULL'). LENGTH is the SQL length of the column. LOCAL is reserved for database-specific information.
- name [ NAME ]
-
Returns or sets the column name.
- type [ TYPE ]
-
Returns or sets the column type.
- null [ NULL ]
-
Returns or sets the column null flag (the empty string is equivalent to `NOT NULL')
- length [ LENGTH ]
-
Returns or sets the column length.
- local [ LOCAL ]
-
Returns or sets the database-specific field.
- line [ $datasrc ]
-
Returns an SQL column definition.
If passed a DBI data source such as `DBI:mysql:database' or `DBI:Pg:dbname=database', will use syntax specific to that database engine. Currently supported databases are MySQL and PostgreSQL. Non-standard syntax for other engines (if applicable) may also be supported in the future.
AUTHOR
Ivan Kohler <ivan-dbix-dbschema@420.am>
COPYRIGHT
Copyright (c) 2000 Ivan Kohler Copyright (c) 2000 Mail Abuse Prevention System LLC All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
BUGS
line() has database-specific foo that probably ought to be abstracted into the DBIx::DBSchema:DBD:: modules.
SEE ALSO
DBIx::DBSchema::Table, DBIx::DBSchema, DBIx::DBSchema::DBD, DBI