Skip to content

Commit

Permalink
Merge branch 'master' into view-deps
Browse files Browse the repository at this point in the history
  • Loading branch information
ribasushi committed Jun 12, 2010
2 parents c418c5c + 9cb6547 commit 49eb552
Show file tree
Hide file tree
Showing 34 changed files with 603 additions and 220 deletions.
19 changes: 19 additions & 0 deletions CONTRIBUTING
@@ -0,0 +1,19 @@
With DBIx::Class on git now, this is the process for contributing.

1) Clone the DBIx::Class master branch
> git clone dbsrgits@git.shadowcat.co.uk:DBIx-Class.git
2) Do your work on your machine. This is git - everything is local!
3) When you think you're ready, push it back out to the origin as a
remote branch. See rebasing for what you should do before pushing.
> git push origin my-branch
4) Notify the other contributors that you're ready to have your branch
reviewed.
5) Another contributor will merge it back into master. See rebasing for
what you should do before merging.

Rebasing: Please rebase before merging and pushing; we'd rather not have
commit messages that say, "Oops" and "typo", in master, and furthermore
fast-forward merges lead to a cleaner history.

Yes, this does mean that DBIx::Class is moving to a formal code review process.
Yes, this does mean that you will never merge your own code to master.
17 changes: 17 additions & 0 deletions Changes
@@ -1,5 +1,21 @@
Revision history for DBIx::Class

0.08123 2010-06-12 14:46 (UTC)
* Fixes
- Make sure Oracle identifier shortener applies to auto-generated
column names, so we stay within the 30-char limit (RT#58271)
- Oracle sequence detection now works across schemas
- Fix a Storage/$dbh leak introduced by the migration to
Try::Tiny (this is *not* a Try::Tiny bug)
- Fix corner case of count with group-by over a 1:1 join column
where the selector ends up with column name clashes
- POD fixes (RT#58247)

* Misc
- Test suite default on-disk database now checks for Win32
fail-conditions even when running on other OSes

0.08122 2010-06-03 17:41 (UTC)
* New Features
- Add DBIx::Class::FilterColumn for non-ref filtering
- ::Storage::DBI now correctly preserves a parent $dbh from
Expand Down Expand Up @@ -62,6 +78,7 @@ Revision history for DBIx::Class

* Misc
- Reformatted Changelog \o/
- DBIC goes git://git.shadowcat.co.uk/dbsrgits/DBIx-Class.git
- Allow developers to skip optional dependency forcing when working
from a checkout
- Add a warning to load_namespaces if a class in ResultSet/ is not
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.SKIP
@@ -1,4 +1,4 @@
^(?!script/|examples/|lib/|inc/|t/|Makefile.PL$|README$|MANIFEST$|Changes$|META.yml$)
^(?!script/|examples/|lib/|inc/|t/|xt/|Makefile.PL$|README$|MANIFEST$|Changes$|META.yml$)


# Avoid version control files.
Expand Down
63 changes: 51 additions & 12 deletions Makefile.PL
@@ -1,4 +1,4 @@
use inc::Module::Install 0.93;
use inc::Module::Install 0.97;
use strict;
use warnings;
use POSIX ();
Expand Down Expand Up @@ -49,6 +49,7 @@ my $runtime_requires = {
'Class::Inspector' => '1.24',
'Data::Page' => '2.00',
'DBI' => '1.609',
'File::Path' => '2.07',
'MRO::Compat' => '0.09',
'Module::Find' => '0.06',
'Path::Class' => '0.18',
Expand All @@ -60,6 +61,8 @@ my $runtime_requires = {
'Context::Preserve' => '0.01',
'Try::Tiny' => '0.04',
'namespace::clean' => '0.14',
'Math::BigInt' => '1.89',
'Math::Base36' => '0.07',
};

# this is so we can order requires alphabetically
Expand Down Expand Up @@ -135,9 +138,9 @@ for my $mod (sort keys %final_req) {
}

# output twice since the deplist is > 70 lines
warn $optdep_msg;
warn $optdep_msg if $Module::Install::AUTHOR;
auto_install();
warn $optdep_msg;
warn $optdep_msg if $Module::Install::AUTHOR;

# re-create various autogenerated documentation bits
if ($Module::Install::AUTHOR) {
Expand All @@ -159,10 +162,26 @@ if ($Module::Install::AUTHOR) {
# PodInherit();
}


tests_recursive (qw|
t
|);

# temporary(?) until I get around to fix M::I wrt xt/
# needs Module::Install::AuthorTests
eval {
recursive_author_tests (qw/xt/);
1;
} || do {
unless ($args->{skip_author_deps}) {
my $err = $@;
eval { require Module::Install::AuthorTests }
|| die "\nYou need Module::Install::AuthorTests installed to run this Makefile.PL in author mode (or supply --skip_author_deps):\n\n$@\n";
die $@;
}
};


install_script (qw|
script/dbicadmin
|);
Expand Down Expand Up @@ -190,11 +209,10 @@ create_distdir : manifest
EOP



homepage 'http://www.dbix-class.org/';
resources 'IRC' => 'irc://irc.perl.org/#dbix-class';
resources 'license' => 'http://dev.perl.org/licenses/';
resources 'repository' => 'http://dev.catalyst.perl.org/repos/bast/DBIx-Class/';
resources 'repository' => 'git://git.shadowcat.co.uk/dbsrgits/DBIx-Class.git';
resources 'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class';

# Deprecated/internal modules need no exposure
Expand All @@ -211,18 +229,39 @@ no_index package => $_ for (qw/

WriteAll();


# Re-write META.yml to _exclude_ all forced requires (we do not want to ship this)
# We are also not using M::I::AuthorRequires as this will be an extra dep, and
# deps in Makefile.PL suck (no autoinstall)
if ($Module::Install::AUTHOR && ! $args->{skip_author_deps} ) {

# FIXME test_requires is not yet part of META
my %original_build_requires = ( %$build_requires, %$test_requires );
my @all_build_requires = @{delete Meta->{values}{build_requires}};
my %removed_build_requires;

print "Regenerating META with author requires excluded\n";
Meta->{values}{build_requires} = [ grep
{ exists $original_build_requires{$_->[0]} }
( @{Meta->{values}{build_requires}} )
];
for (@all_build_requires) {
if ($original_build_requires{$_->[0]}) {
push @{Meta->{values}{build_requires}}, $_;
}
else {
$removed_build_requires{$_->[0]} = $_->[1]
unless $_->[0] eq 'ExtUtils::MakeMaker';
}
}

print "Regenerating META with author requires excluded\n";
Meta->write;

# test that we really took things away (just in case)
my $meta = do { local @ARGV = 'META.yml'; local $/; <> };
for (keys %removed_build_requires) {
delete $removed_build_requires{$_}
unless $meta =~ /^ \s+ $_: \s+ $removed_build_requires{$_} \s* $/mx
}

if (keys %removed_build_requires) {
die join ("\n", "\n\nFATAL FAIL! It looks like some author dependencies made it to the META.yml:\n",
map { "\t$_" } (keys %removed_build_requires)
) . "\n\n";
}
}
9 changes: 0 additions & 9 deletions TODO
Expand Up @@ -9,14 +9,6 @@
- double-sided relationships
- make short form of class specifier in relationships work

2006-01-31 by bluefeet
- Create a DBIx::Class::FilterColumn to replace inflate/deflate. This
component would provide a new syntax for filtering column update and
retrieval through a simple syntax. The syntax would be:
__PACKAGE__->add_columns(phone => { set=>sub{ ... }, get=>sub{ ... } });
We should still support the old inflate/deflate syntax, but this new
way should be recommended.

2006-03-18 by bluefeet
- Support table locking.

Expand All @@ -36,5 +28,4 @@
- Rewrite the test suite to rely on $schema->deploy, allowing for seamless
testing of various RDBMS using the same tests
- Automatically infer quote_char/name_sep from $schema->storage
- Fix and properly test chained search attribute merging
- Recursive update() (all code seems to be already available)
14 changes: 9 additions & 5 deletions lib/DBIx/Class.pm
Expand Up @@ -27,7 +27,7 @@ sub component_base_class { 'DBIx::Class' }
# Always remember to do all digits for the version even if they're 0
# i.e. first release of 0.XX *must* be 0.XX000. This avoids fBSD ports
# brain damage and presumably various other packaging systems too
$VERSION = '0.08121_01';
$VERSION = '0.08123_01';

$VERSION = eval $VERSION if $VERSION =~ /_/; # numify for warning-free dev releases

Expand Down Expand Up @@ -61,16 +61,18 @@ The community can be found via:
=over
=item * IRC: L<irc.perl.org#dbix-class (click for instant chatroom login)
|http://mibbit.com/chat/#dbix-class@irc.perl.org>
=item * IRC: irc.perl.org#dbix-class
=for html
<a href="http://mibbit.com/chat/#dbix-class@irc.perl.org">(click for instant chatroom login)</a>
=item * Mailing list: L<http://lists.scsys.co.uk/mailman/listinfo/dbix-class>
=item * RT Bug Tracker: L<https://rt.cpan.org/Dist/Display.html?Queue=DBIx-Class>
=item * SVNWeb: L<http://dev.catalyst.perl.org/svnweb/bast/browse/DBIx-Class/0.08>
=item * gitweb: L<http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits/DBIx-Class.git>
=item * SVN: L<http://dev.catalyst.perl.org/repos/bast/DBIx-Class/0.08>
=item * git: L<git://git.shadowcat.co.uk/dbsrgits/DBIx-Class.git>
=back
Expand Down Expand Up @@ -283,6 +285,8 @@ gphat: Cory G Watson <gphat@cpan.org>
groditi: Guillermo Roditi <groditi@cpan.org>
Haarg: Graham Knop <haarg@haarg.org>
hobbs: Andrew Rodland <arodland@cpan.org>
ilmari: Dagfinn Ilmari MannsE<aring>ker <ilmari@ilmari.org>
Expand Down
22 changes: 11 additions & 11 deletions lib/DBIx/Class/Manual/Cookbook.pod
Expand Up @@ -151,7 +151,7 @@ Note that you cannot have bind parameters unless is_virtual is set to true.
=item * NOTE

If you're using the old deprecated C<< $rsrc_instance->name(\'( SELECT ...') >>
method for custom SQL execution, you are highly encouraged to update your code
method for custom SQL execution, you are highly encouraged to update your code
to use a virtual view as above. If you do not want to change your code, and just
want to suppress the deprecation warning when you call
L<DBIx::Class::Schema/deploy>, add this line to your source definition, so that
Expand Down Expand Up @@ -202,7 +202,7 @@ to access the returned value:
# FROM artist

Note that the C<as> attribute B<has absolutely nothing to do> with the SQL
syntax C< SELECT foo AS bar > (see the documentation in
syntax C< SELECT foo AS bar > (see the documentation in
L<DBIx::Class::ResultSet/ATTRIBUTES>). You can control the C<AS> part of the
generated SQL via the C<-as> field attribute as follows:

Expand All @@ -218,10 +218,10 @@ generated SQL via the C<-as> field attribute as follows:
);

# Equivalent SQL
# SELECT me.artistid, me.name, me.rank, me.charfield, COUNT( cds.cdid ) AS amount_of_cds
# FROM artist me LEFT JOIN cd cds ON cds.artist = me.artistid
# GROUP BY me.artistid, me.name, me.rank, me.charfield
# ORDER BY amount_of_cds DESC
# SELECT me.artistid, me.name, me.rank, me.charfield, COUNT( cds.cdid ) AS amount_of_cds
# FROM artist me LEFT JOIN cd cds ON cds.artist = me.artistid
# GROUP BY me.artistid, me.name, me.rank, me.charfield
# ORDER BY amount_of_cds DESC


If your alias exists as a column in your base class (i.e. it was added with
Expand Down Expand Up @@ -1280,7 +1280,7 @@ row.

my $schema = MySchema->connect("dbi:Pg:dbname=my_db");

# Start a transaction. Every database change from here on will only be
# Start a transaction. Every database change from here on will only be
# committed into the database if the try block succeeds.
use Try::Tiny;
my $exception;
Expand Down Expand Up @@ -1326,7 +1326,7 @@ row.
# next $thing
print "Cannot create thing: $_";
}
# There was no error, so save all changes since the last
# There was no error, so save all changes since the last
# savepoint.

# SQL: RELEASE SAVEPOINT savepoint_0;
Expand Down Expand Up @@ -1781,7 +1781,7 @@ database if the C<mysql_enable_utf8> is set in the connect options.
my $schema = My::Schema->connection('dbi:mysql:dbname=test',
$user, $pass,
{ mysql_enable_utf8 => 1} );


When set, a data retrieved from a textual column type (char,
varchar, etc) will have the UTF-8 flag turned on if necessary. This
Expand Down Expand Up @@ -2046,7 +2046,7 @@ mechanism:
sub query_start {
my $self = shift();
my $sql = shift();
my $params = @_;
my @params = @_;

$self->print("Executing $sql: ".join(', ', @params)."\n");
$start = time();
Expand Down Expand Up @@ -2116,7 +2116,7 @@ time, but not so large that the table is locked for an unacceptably long time.

If using L<create|DBIx::Class::ResultSet/create> instead, use a transaction and
commit every C<X> rows; where C<X> gives you the best performance without
locking the table for too long.
locking the table for too long.

=item *

Expand Down
16 changes: 14 additions & 2 deletions lib/DBIx/Class/ResultSet.pm
Expand Up @@ -1274,6 +1274,8 @@ sub _count_subq_rs {
# Calculate subquery selector
if (my $g = $sub_attrs->{group_by}) {

my $sql_maker = $rsrc->storage->sql_maker;

# necessary as the group_by may refer to aliased functions
my $sel_index;
for my $sel (@{$attrs->{select}}) {
Expand All @@ -1282,7 +1284,17 @@ sub _count_subq_rs {
}

for my $g_part (@$g) {
push @{$sub_attrs->{select}}, $sel_index->{$g_part} || $g_part;
my $colpiece = $sel_index->{$g_part} || $g_part;

# disqualify join-based group_by's. Arcane but possible query
# also horrible horrible hack to alias a column (not a func.)
# (probably need to introduce SQLA syntax)
if ($colpiece =~ /\./ && $colpiece !~ /^$attrs->{alias}\./) {
my $as = $colpiece;
$as =~ s/\./__/;
$colpiece = \ sprintf ('%s AS %s', map { $sql_maker->_quote ($_) } ($colpiece, $as) );
}
push @{$sub_attrs->{select}}, $colpiece;
}
}
else {
Expand Down Expand Up @@ -2179,7 +2191,7 @@ or C<has_one> resultset. Note Arrayref.
);
Example of creating a new row and also creating a row in a related
C<belongs_to>resultset. Note Hashref.
C<belongs_to> resultset. Note Hashref.
$cd_rs->create({
title=>"Music for Silly Walks",
Expand Down

0 comments on commit 49eb552

Please sign in to comment.