subbta.blogg.se

Dbschema show columns
Dbschema show columns











dbschema show columns

The first is a list of column alteration SQL fragments for an ALTER TABLE statement. (To create a new table, see "sql_create_table" in DBIx::DBSchema::Table instead.) Returns SQL to add this column to an existing table. Returns this column's default value quoted for the database.

dbschema show columns

Non-standard syntax for other engines (if applicable) may also be supported in the future. Currently supported databases are MySQL and PostgreSQL. If passed a DBI data source (or handle) such as `DBI:mysql:database' or `DBI:Pg:dbname=database', will use syntax specific to that database engine. The data source can be specified by passing an open DBI database handle, or by passing the DBI data source name, username and password.Īlthough the username and password are optional, it is best to call this method with a database handle or data source including a valid username and password - a DBI connection will be opened and the quoting and type mapping will be more reliable. Returns the table name, or the empty string if this column has not yet been assigned to a table. Typically set internally when a column object is added to a table object. Returns or sets the table object (see DBIx::DBSchema::Table). Returns or sets the database-specific field. Returns or sets the column null flag (the empty string is equivalent to `NOT NULL') length

dbschema show columns

This can be used to pass SQL functions such as now() or explicit empty strings as '' as defaults.

dbschema show columns

Note: If you pass a scalar reference as the default rather than a scalar value, it will be dereferenced and quoting will be forced off. local is reserved for database-specific information. default is the default value of the column. null is the nullability of the column (intrepreted using Perl's rules for truth, with one exception: `NOT NULL' is false). Takes a hashref of named parameters, or a list. METHODS new HASHREF new ] ] ] ] ]Ĭreates a new DBIx::DBSchema::Column object. $sql_add_column = $column->sql_add_column($datasrc) DESCRIPTIONĭBIx::DBSchema::Column objects represent columns in tables (see DBIx::DBSchema::Table). $sql_add_column = $column->sql_add_column $column = new DBIx::DBSchema::Column ( $name, $sql_type, $nullability, $length, $default, $local ) DBIx::DBSchema::Column - Column objects SYNOPSIS use DBIx::DBSchema::Column













Dbschema show columns