Why did you reject DBIC? It's probably what you want. The following is a brief tour of its power.

Multi-Table-Mapping-Objects

Pseudo-code which assumes some manual set-up in the schema files (many to many relationships are not discoverable and the example would require overload on the role class to work as shown)–

for my $user ( $users->all ) { print $user->name, $/; print " Roles: ", join(", ", $user->roles) || "none", $/; for my $role ( $user->roles ) { print "Users in this role: "; print join(", ", map { $_->name } $role->role->users); } }

DBIC has notions of the column, the resultset, the table, the record, the connection, the relationships, and more. Many ORMs are record oriented and get ugly/stuck easily since it's all a ball of mud around a row. DBIC handles this really nicely.

Lazy-Loading (Single Columns as well as groups of columns)

my $full_rs = $schema->resultset("user"); my @ids = $full_rs->get_column("id")->all; # -or- my $simple_rs = $full_rs->search({}, { columns => [qw/ id /] }); print $_->id, $/ for $simple_rs->all; # -or, no objects- # use parent "DBIx::Class::ResultSet::HashRef"; <- in resultset class. my $ids = map { $_->{id} } $schema->resultset("user") ->search({},{columns => ["id"]) ->hashref_rs ->all;

Agregation Functions

The get_column above is an example. DBIx::Class::ResultSetColumn has more, like–

printf "\$%.2f\n", $user->orders->get_column("total")->sum;

All sorts of relationships

Also see the amazing DBIx::Class::Tree::Mobius for an inner-relationship hybrid of nested intervals and materialized paths.

Flexible ways to query data from database

Chained resultsets are everything good in the world. You essentially build up complementary named fragments and make your code compact, syntactical, and fun. For example (assumes you wrote the resultset code, which is easy, to do it)–

$schema->resultset("Company") ->find($id) ->users ->active ->with_overdue_balance;

Multi-Database-Support

No. Yes. What?

DBIC supports pretty much everything DBI does. It does not support joining across DBs. You can certainly have a schema instance for each DB exchanging information at the Perl level.

More reading

Update: missing adverbly.


In reply to Re: Search for ORM with Multi-Table-Object Support by Your Mother
in thread Search for ORM with Multi-Table-Object Support by Xel

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.