[Bast-commits] r6979 - in DBIx-Class/0.08/trunk/lib/DBIx/Class: .
Storage/DBI/Replicated
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Sat Jul 4 09:34:08 GMT 2009
Author: ribasushi
Date: 2009-07-04 09:34:08 +0000 (Sat, 04 Jul 2009)
New Revision: 6979
Modified:
DBIx-Class/0.08/trunk/lib/DBIx/Class/SQLAHacks.pm
DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Replicated/Types.pm
Log:
Hide devel documentation from the indexer
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/SQLAHacks.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/SQLAHacks.pm 2009-07-03 19:35:38 UTC (rev 6978)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/SQLAHacks.pm 2009-07-04 09:34:08 UTC (rev 6979)
@@ -1,6 +1,10 @@
package # Hide from PAUSE
DBIx::Class::SQLAHacks;
+# This module is a subclass of SQL::Abstract::Limit and includes a number
+# of DBIC-specific workarounds, not yet suitable for inclusion into the
+# SQLA core
+
use base qw/SQL::Abstract::Limit/;
use strict;
use warnings;
@@ -28,6 +32,9 @@
}
}
+
+# Tries to determine limit dialect.
+#
sub new {
my $self = shift->SUPER::new(@_);
@@ -40,14 +47,12 @@
$self;
}
-
# Some databases (sqlite) do not handle multiple parenthesis
-# around in/between arguments. A tentative x IN ( ( 1, 2 ,3) )
+# around in/between arguments. A tentative x IN ( (1, 2 ,3) )
# is interpreted as x IN 1 or something similar.
#
# Since we currently do not have access to the SQLA AST, resort
# to barbaric mutilation of any SQL supplied in literal form
-
sub _strip_outer_paren {
my ($self, $arg) = @_;
@@ -316,6 +321,8 @@
update => 'FOR UPDATE',
shared => 'FOR SHARE',
};
+# Quotes table names, handles "limit" dialects (e.g. where rownum between x and
+# y), supports SELECT ... FOR UPDATE and SELECT ... FOR SHARE.
sub select {
my ($self, $table, $fields, $where, $order, @rest) = @_;
@@ -342,6 +349,7 @@
return wantarray ? ($sql, @{$self->{from_bind}}, @where_bind, @{$self->{having_bind}}, @{$self->{order_bind}} ) : $sql;
}
+# Quotes table names, and handles default inserts
sub insert {
my $self = shift;
my $table = shift;
@@ -357,6 +365,7 @@
$self->SUPER::insert($table, @_);
}
+# Just quotes table names.
sub update {
my $self = shift;
my $table = shift;
@@ -364,6 +373,7 @@
$self->SUPER::update($table, @_);
}
+# Just quotes table names.
sub delete {
my $self = shift;
my $table = shift;
@@ -592,12 +602,15 @@
return $self->{limit_dialect};
}
+# Set to an array-ref to specify separate left and right quotes for table names.
+# A single scalar is equivalen to [ $char, $char ]
sub quote_char {
my $self = shift;
$self->{quote_char} = shift if @_;
return $self->{quote_char};
}
+# Character separating quoted table names.
sub name_sep {
my $self = shift;
$self->{name_sep} = shift if @_;
@@ -605,50 +618,3 @@
}
1;
-
-__END__
-
-=pod
-
-=head1 NAME
-
-DBIx::Class::SQLAHacks - This module is a subclass of SQL::Abstract::Limit
-and includes a number of DBIC-specific workarounds, not yet suitable for
-inclusion into SQLA proper.
-
-=head1 METHODS
-
-=head2 new
-
-Tries to determine limit dialect.
-
-=head2 select
-
-Quotes table names, handles "limit" dialects (e.g. where rownum between x and
-y), supports SELECT ... FOR UPDATE and SELECT ... FOR SHARE.
-
-=head2 insert update delete
-
-Just quotes table names.
-
-=head2 limit_dialect
-
-Specifies the dialect of used for implementing an SQL "limit" clause for
-restricting the number of query results returned. Valid values are: RowNum.
-
-See L<DBIx::Class::Storage::DBI/connect_info> for details.
-
-=head2 name_sep
-
-Character separating quoted table names.
-
-See L<DBIx::Class::Storage::DBI/connect_info> for details.
-
-=head2 quote_char
-
-Set to an array-ref to specify separate left and right quotes for table names.
-
-See L<DBIx::Class::Storage::DBI/connect_info> for details.
-
-=cut
-
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Replicated/Types.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Replicated/Types.pm 2009-07-03 19:35:38 UTC (rev 6978)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Replicated/Types.pm 2009-07-04 09:34:08 UTC (rev 6979)
@@ -1,13 +1,9 @@
package # hide from PAUSE
DBIx::Class::Storage::DBI::Replicated::Types;
-=head1 NAME
+# DBIx::Class::Storage::DBI::Replicated::Types - Types used internally by
+# L<DBIx::Class::Storage::DBI::Replicated>
-DBIx::Class::Storage::DBI::Replicated::Types - Types used internally by
-L<DBIx::Class::Storage::DBI::Replicated>
-
-=cut
-
use MooseX::Types
-declare => [qw/BalancerClassNamePart Weight/];
use MooseX::Types::Moose qw/ClassName Str Num/;
@@ -17,16 +13,16 @@
subtype BalancerClassNamePart,
as ClassName;
-
+
coerce BalancerClassNamePart,
from Str,
via {
my $type = $_;
if($type=~m/^::/) {
$type = 'DBIx::Class::Storage::DBI::Replicated::Balancer'.$type;
- }
- Class::MOP::load_class($type);
- $type;
+ }
+ Class::MOP::load_class($type);
+ $type;
};
subtype Weight,
@@ -34,14 +30,12 @@
where { $_ >= 0 },
message { 'weight must be a decimal greater than 0' };
-=head1 AUTHOR
+# AUTHOR
+#
+# John Napiorkowski <john.napiorkowski at takkle.com>
+#
+# LICENSE
+#
+# You may distribute this code under the same terms as Perl itself.
- John Napiorkowski <john.napiorkowski at takkle.com>
-
-=head1 LICENSE
-
-You may distribute this code under the same terms as Perl itself.
-
-=cut
-
1;
More information about the Bast-commits
mailing list