1 package DBIx::DBSchema::DBD;
10 DBIx::DBSchema::DBD - DBIx::DBSchema Driver Writer's Guide and Base Class
14 perldoc DBIx::DBSchema::DBD
16 package DBIx::DBSchema::DBD::FooBase
17 use DBIx::DBSchmea::DBD;
18 @ISA = qw(DBIx::DBSchema::DBD);
22 Drivers should be named DBIx::DBSchema::DBD::DatabaseName, where DatabaseName
23 is the same as the DBD:: driver for this database. Drivers should implement the
24 following class methods:
28 =item columns CLASS DBI_DBH TABLE
30 Given an active DBI database handle, return a listref of listrefs (see
31 L<perllol>), each containing six elements: column name, column type,
32 nullability, column length, column default, and a field reserved for
35 =item column CLASS DBI_DBH TABLE COLUMN
37 Same as B<columns> above, except return the listref for a single column. You
38 can inherit from DBIx::DBSchema::DBD to provide this function.
43 my($proto, $dbh, $table, $column) = @_;
44 #@a = grep { $_->[0] eq $column } @{ $proto->columns( $dbh, $table ) };
47 grep { $_->[0] eq $column } @{ $proto->columns( $dbh, $table ) }
48 ] }[0]; #force list context on grep, return scalar of first element
51 =item primary_key CLASS DBI_DBH TABLE
53 Given an active DBI database handle, return the primary key for the specified
56 =item unique CLASS DBI_DBH TABLE
58 Given an active DBI database handle, return a hashref of unique indices. The
59 keys of the hashref are index names, and the values are arrayrefs which point
60 a list of column names for each. See L<perldsc/"HASHES OF LISTS"> and
61 L<DBIx::DBSchema::ColGroup>.
63 =item index CLASS DBI_DBH TABLE
65 Given an active DBI database handle, return a hashref of (non-unique) indices.
66 The keys of the hashref are index names, and the values are arrayrefs which
67 point a list of column names for each. See L<perldsc/"HASHES OF LISTS"> and
68 L<DBIx::DBSchema::ColGroup>.
74 Ivan Kohler <ivan-dbix-dbschema@420.am>
78 Copyright (c) 2000 Ivan Kohler
79 Copyright (c) 2000 Mail Abuse Prevention System LLC
81 This program is free software; you can redistribute it and/or modify it under
82 the same terms as Perl itself.
86 %typemap needs to be documented.
90 L<DBIx::DBSchema>, L<DBIx::DBSchema::DBD::mysql>, L<DBIx::DBSchema::DBD::Pg>,
91 L<DBIx::DBSchema::ColGroup>, L<DBI>, L<DBI::DBD>, L<perllol>,
92 L<perldsc/"HASHES OF LISTS">