From: Rafael Kitover Date: Tue, 1 Jun 2010 15:24:21 +0000 (+0000) Subject: Merge 'namespace-clean' into 'trunk' X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2265a41b568ce018b0e38681ee9b161f1522347b;p=dbsrgits%2FDBIx-Class-Historic.git Merge 'namespace-clean' into 'trunk' r24518@hlagh (orig r9512): rkitover | 2010-06-01 09:16:09 -0400 branch to use namespace::clean r24523@hlagh (orig r9517): rkitover | 2010-06-01 10:47:03 -0400 use namespace::cleaned out imports for some common utilities r24526@hlagh (orig r9520): rkitover | 2010-06-01 11:23:36 -0400 remove useless use of n::c --- 2265a41b568ce018b0e38681ee9b161f1522347b diff --cc lib/DBIx/Class/SQLAHacks.pm index 82c1ffb,db67bcf..7ea8daa --- a/lib/DBIx/Class/SQLAHacks.pm +++ b/lib/DBIx/Class/SQLAHacks.pm @@@ -8,8 -8,10 +8,10 @@@ package # Hide from PAUS use base qw/SQL::Abstract::Limit/; use strict; use warnings; -use Carp::Clan qw/^DBIx::Class|^SQL::Abstract/; +use Carp::Clan qw/^DBIx::Class|^SQL::Abstract|^Try::Tiny/; - use Sub::Name(); + use List::Util 'first'; + use Sub::Name 'subname'; + use namespace::clean; BEGIN { # reinstall the carp()/croak() functions imported into SQL::Abstract diff --cc lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm index 87e5b05,368ef42..0a7294d --- a/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm +++ b/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm @@@ -408,94 -361,10 +408,94 @@@ sub with_deferred_fk_checks $self->_do_query('alter session set constraints = immediate'); }); - return Context::Preserve::preserve_context(sub { $sub->() }, - after => sub { $txn_scope_guard->commit }); + return + preserve_context { $sub->() } after => sub { $txn_scope_guard->commit }; } +=head1 ATTRIBUTES + +Following additional attributes can be used in resultsets. + +=head2 connect_by or connect_by_nocycle + +=over 4 + +=item Value: \%connect_by + +=back + +A hashref of conditions used to specify the relationship between parent rows +and child rows of the hierarchy. + + + connect_by => { parentid => 'prior personid' } + + # adds a connect by statement to the query: + # SELECT + # me.persionid me.firstname, me.lastname, me.parentid + # FROM + # person me + # CONNECT BY + # parentid = prior persionid + + + connect_by_nocycle => { parentid => 'prior personid' } + + # adds a connect by statement to the query: + # SELECT + # me.persionid me.firstname, me.lastname, me.parentid + # FROM + # person me + # CONNECT BY NOCYCLE + # parentid = prior persionid + + +=head2 start_with + +=over 4 + +=item Value: \%condition + +=back + +A hashref of conditions which specify the root row(s) of the hierarchy. + +It uses the same syntax as L + + start_with => { firstname => 'Foo', lastname => 'Bar' } + + # SELECT + # me.persionid me.firstname, me.lastname, me.parentid + # FROM + # person me + # START WITH + # firstname = 'foo' and lastname = 'bar' + # CONNECT BY + # parentid = prior persionid + +=head2 order_siblings_by + +=over 4 + +=item Value: ($order_siblings_by | \@order_siblings_by) + +=back + +Which column(s) to order the siblings by. + +It uses the same syntax as L + + 'order_siblings_by' => 'firstname ASC' + + # SELECT + # me.persionid me.firstname, me.lastname, me.parentid + # FROM + # person me + # CONNECT BY + # parentid = prior persionid + # ORDER SIBLINGS BY + # firstname ASC + =head1 AUTHOR See L.