DBIx::DBSchema::DBD - DBIx::DBSchema Driver Writer's Guide and Base Class
perldoc DBIx::DBSchema::DBD package DBIx::DBSchema::DBD::FooBase use DBIx::DBSchema::DBD; @ISA = qw(DBIx::DBSchema::DBD);
Drivers should be named DBIx::DBSchema::DBD::DatabaseName, where DatabaseName is the same as the DBD:: driver for this database. Drivers should implement the following class methods:
Given an active DBI database handle, return a listref of listrefs (see perllol), each containing six elements: column name, column type, nullability, column length, column default, and a field reserved for driver-specific use.
Same as columns above, except return the listref for a single column. You can inherit from DBIx::DBSchema::DBD to provide this function.
Given an active DBI database handle, return the primary key for the specified table.
Deprecated method - see the indices method for new drivers.
Given an active DBI database handle, return a hashref of unique indices. The keys of the hashref are index names, and the values are arrayrefs which point a list of column names for each. See "HASHES OF LISTS" in perldsc and DBIx::DBSchema::Index.
Given an active DBI database handle, return a hashref of (non-unique) indices. The keys of the hashref are index names, and the values are arrayrefs which point a list of column names for each. See "HASHES OF LISTS" in perldsc and DBIx::DBSchema::Index.
Given an active DBI database handle, return a hashref of all indices, both unique and non-unique. The keys of the hashref are index names, and the values are again hashrefs with the following keys:
(See FS::DBIx::DBSchema::Index)
New drivers are advised to implement this method, and existing drivers are advised to (eventually) provide this method instead of index and unique.
For backwards-compatibility with current drivers, the base DBIx::DBSchema::DBD class provides an indices method which uses the old index and unique methods to provide this data.
Returns the default database catalog for the DBI table_info command. Inheriting from DBIx::DBSchema::DBD will provide the default empty string.
Returns the default database schema for the DBI table_info command. Inheriting from DBIx::DBSchema::DBD will provide the default empty string.
You can define a %typemap array for your driver to map "standard" data types to database-specific types. For example, the MySQL TIMESTAMP field has non-standard auto-updating semantics; the MySQL DATETIME type is what other databases and the ODBC standard call TIMESTAMP, so one of the entries in the MySQL %typemap is:
'TIMESTAMP' => 'DATETIME',
Another example is the Pg %typemap which maps the standard types BLOB and LONG VARBINARY to the Pg-specific BYTEA:
'BLOB' => 'BYTEA', 'LONG VARBINARY' => 'BYTEA',
Make sure you use all uppercase-keys.
Ivan Kohler <ivan-dbix-dbschema@420.am>
Copyright (c) 2000-2005 Ivan Kohler All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
DBIx::DBSchema, DBIx::DBSchema::DBD::mysql, DBIx::DBSchema::DBD::Pg, DBIx::DBSchema::Index, DBI, DBI::DBD, perllol, "HASHES OF LISTS" in perldsc
To install DBIx::DBSchema, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBIx::DBSchema
CPAN shell
perl -MCPAN -e shell install DBIx::DBSchema
For more information on module installation, please visit the detailed CPAN module installation guide.