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

Fey::Loader::DBI - Base class (and fallback) for loading a schema

SYNOPSIS

  my $loader = Fey::Loader->new( dbh => $dbh );

  my $schema = $loader->make_schema( name => $name );

DESCRIPTION

Fey::Loader::DBI will create a schema by using the various DBI info methods. It is a complete implementation of a loader, but it only works if the driver in question fully supports the info methods needed, which many don't. In addition, some information simply isn't available via those methods, like whether a column is auto-incremented.

For that reason, you probably won't get good results for your schema unless there is a driver-specific loader subclass for your DBMS.

METHODS

This class provides the following methods:

Fey::Loader::DBI->new( dbh => $dbh )

Given a database handle, returns a new Fey::Loader::DBI object. You probably want to call Fey::Loader-new()> instead, though.

To change the classes used to build up the schema and its related objects, you may provide schema_class, table_class, column_class, and fk_class parameters; they default to Fey::Schema, Fey::Table, Fey::Column, and Fey::FK respectively.

$loader->make_schema( name => $name )

This method returns a new, fully-populated Fey::Schema object. The name parameter is optional, and if given will be used as the name of the new schema. Otherwise the name will be found through the DBI handle.

AUTHOR

Dave Rolsky, <autarch@urth.org>

BUGS

Please report any bugs or feature requests to bug-fey-loader@rt.cpan.org, or through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

COPYRIGHT & LICENSE

Copyright 2006-2008 Dave Rolsky, All Rights Reserved.

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