GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  DBIX::CLASS::LOADER (3)

.ds Aq ’

NAME

DBIx::Class::Loader - Dynamic definition of DBIx::Class sub classes.

CONTENTS

SYNOPSIS



  use DBIx::Class::Loader;

  my $loader = DBIx::Class::Loader->new(
    dsn                     => "dbi:mysql:dbname",
    user                    => "root",
    password                => "",
    namespace               => "Data",
    additional_classes      => [qw/DBIx::Class::Foo/],
    additional_base_classes => [qw/My::Stuff/],
    left_base_classes       => [qw/DBIx::Class::Bar/],
    constraint              => ^foo.*,
    relationships           => 1,
    options                 => { AutoCommit => 1 },
    inflect                 => { child => children },
    debug                   => 1,
  );
  my $class = $loader->find_class(film); # $class => Data::Film
  my $obj = $class->find(1);



use with mod_perl

in your startup.pl



  # load all tables
  use DBIx::Class::Loader;
  my $loader = DBIx::Class::Loader->new(
    dsn       => "dbi:mysql:dbname",
    user      => "root",
    password  => "",
    namespace => "Data",
  );



in your web application.



  use strict;

  # you can use Data::Film directly
  my $film = Data::Film->retrieve($id);



IMPORTANT NOTICE

This module is deprecated in favor of DBIx::Class::Schema::Loader for use with DBIx::Class versions 0.05 and higher. It continues to function as well as it ever did, even for recent DBIx::Class releases, and will be maintained for some time to counter bugs, but it doesn’t use the now-preferred DBIx::Class::Schema way of doing things, and tends to promote bad DBIx::Class usage habits.

DESCRIPTION

DBIx::Class::Loader automate the definition of DBIx::Class sub-classes by scanning table schemas and setting up columns and primary keys.

Class names are defined by table names and the namespace option. The only required arguments are namespace and dsn.



 +---------+-----------+--------------+
 | table   | namespace | class        |
 +---------+-----------+--------------+
 | foo     | Data      | Data::Foo    |
 | foo_bar | MyDB      | MyDB::FooBar |
 +---------+-----------+--------------+



DBIx::Class::Loader supports MySQL, Postgres, SQLite and DB2. See DBIx::Class::Loader::Generic for more, and DBIx::Class::Loader::Writing for notes on writing your own db-specific subclass for an unsupported db.

METHODS

    new

Example in Synopsis above demonstrates the available arguments. For detailed information on the arguments, see the DBIx::Class::Loader::Generic documentation.

SUPPORT

Bug reports to Brandon L Black blblack@gmail.com, or the mailing list dbix-class@lists.rawmode.org, or visit #dbix-class on irc.perl.org.

AUTHOR

Sebastian Riedel, sri@oook.de

Based upon the work of IKEBE Tomohiro

THANK YOU

Adam Anderson, Andy Grundman, Autrijus Tang, Dan Kubb, David Naughton, Randal Schwartz, Simon Flack and all the others who’ve helped.

LICENSE

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

SEE ALSO

DBIx::Class
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 DBIX::CLASS::LOADER (3) 2006-02-27

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.