Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Programming > Perl Modules

    DBIx::Class::ResultSource::MultipleTableInheritance 0.01

    Download button

    No screenshots available
    Downloads: 106  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Amiri Barksdale | More programs
    Perl Artistic License / FREE
    October 7th, 2011, 03:30 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    DBIx::Class::ResultSource::MultipleTableInheritance description

    Use multiple tables to define your classes

    DBIx::Class::ResultSource::MultipleTableInheritance is a Perl module that allows to use multiple tables to define your classes.

    This only works with PostgreSQL at the moment. It has been tested with PostgreSQL 9.0, 9.1 beta, and 9.1.

    There is one additional caveat: the "parent" result classes that you defined with this resultsource must have one primary column and it must be named "id."

    SYNOPSIS

     {
     package Cafe::Result::Coffee;

     use strict;
     use warnings;
     use parent 'DBIx::Class::Core';
     use aliased 'DBIx::Class::ResultSource::MultipleTableInheritance'
     => 'MTI';

     __PACKAGE__->table_class(MTI);
     __PACKAGE__->table('coffee');
     __PACKAGE__->add_columns(
     "id", { data_type => "integer" },
     "flavor", {
     data_type => "text",
     default_value => "good" },
     );

     __PACKAGE__->set_primary_key("id");

     1;
     }

     {
     package Cafe::Result::Sumatra;

     use parent 'Cafe::Result::Coffee';

     __PACKAGE__->table('sumatra');

     __PACKAGE__->add_columns( "aroma",
     { data_type => "text" }
     );

     1;
     }

     ...

     my $schema = Cafe->connect($dsn,$user,$pass);

     my $cup = $schema->resultset('Sumatra');

     print STDERR Dwarn $cup->result_source->columns;

     "id"
     "flavor"
     "aroma"
     ..



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    multiple tables | define class | Perl module | Perl | multiple | tables

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM