From: Brandon L. Black Date: Tue, 1 May 2007 05:41:32 +0000 (+0000) Subject: Merge 'trunk' into 'DBIx-Class-current' X-Git-Tag: v0.08010~150^2~83 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ca83d811f3ce60ebb819ce9ad54179837f6157c6;p=dbsrgits%2FDBIx-Class.git Merge 'trunk' into 'DBIx-Class-current' r20551@brandon-blacks-computer (orig r3005): castaway | 2007-01-05 03:25:11 -0600 add inflatecolumn fixes to Changes r20553@brandon-blacks-computer (orig r3007): castaway | 2007-01-09 15:20:55 -0600 todoify collapse test r20554@brandon-blacks-computer (orig r3008): castaway | 2007-01-09 15:42:59 -0600 Up version to 0.07004 r20555@brandon-blacks-computer (orig r3009): castaway | 2007-01-09 15:44:39 -0600 0.07004 r20556@brandon-blacks-computer (orig r3010): castaway | 2007-01-10 11:54:19 -0600 Skip .orig files in dist r20557@brandon-blacks-computer (orig r3011): castaway | 2007-01-10 13:37:23 -0600 oops, remove .orig files etc r20599@brandon-blacks-computer (orig r3053): zarquon | 2007-01-23 04:15:05 -0600 minor doc improvement to clarify how to do joins r20604@brandon-blacks-computer (orig r3058): zarquon | 2007-01-24 15:48:07 -0600 explained a cryptic error message r20610@brandon-blacks-computer (orig r3064): castaway | 2007-01-29 10:28:12 -0600 Make POD a little more obvious about component order --This line, and those below, will be ignored-- M DateTime.pm r20616@brandon-blacks-computer (orig r3070): jester | 2007-01-31 17:59:06 -0600 Doc cleanup in Ordered.pm r20618@brandon-blacks-computer (orig r3072): castaway | 2007-02-02 13:48:53 -0600 POD updates r20619@brandon-blacks-computer (orig r3073): ash | 2007-02-03 15:33:19 -0600 Made ->update not change the hashref passed in (with test.) r20621@brandon-blacks-computer (orig r3075): ash | 2007-02-05 06:29:52 -0600 Backed out my r3073, and doc'd the fact that it takes a hashref that might be changed r20622@brandon-blacks-computer (orig r3076): castaway | 2007-02-05 07:56:35 -0600 Add _accessor example, thanks to grinktt3n r20623@brandon-blacks-computer (orig r3077): castaway | 2007-02-05 08:23:22 -0600 Fix overload example r20625@brandon-blacks-computer (orig r3079): grink1tt3n | 2007-02-06 13:40:00 -0600 Added; FAQ-fetch-a-formatted-column.txt FAQ-store-JSON-in-a-column.txt r20640@brandon-blacks-computer (orig r3094): castaway | 2007-02-08 02:25:54 -0600 Argh! Fix spurious example r20643@brandon-blacks-computer (orig r3097): castaway | 2007-02-13 08:00:21 -0600 Improve resultset_attributes docs r20644@brandon-blacks-computer (orig r3098): grink1tt3n | 2007-02-14 01:16:40 -0600 Fleshed out the JSON inflated column example with a corresponding YAML example. Added a cautionary warning against overuse. Added a link to InflateColumn. r20645@brandon-blacks-computer (orig r3099): grink1tt3n | 2007-02-14 02:39:26 -0600 Added how to '.. fetch a single (or topmost) row?' to the FAQ r20646@brandon-blacks-computer (orig r3100): zarquon | 2007-02-14 02:44:18 -0600 improved docs for as attrib r20647@brandon-blacks-computer (orig r3101): zarquon | 2007-02-14 04:05:51 -0600 pointed out ambiguity of as attribs r26909@brandon-blacks-computer (orig r3107): castaway | 2007-03-03 06:15:03 -0600 Fix to $filename from Carl Vincent r27114@brandon-blacks-computer (orig r3126): jshirley | 2007-03-12 16:27:08 -0500 Updating Manual/Intro to reflect better -in => [] usage, adding myself to contributors (mst put me in dbic-devel, too) r27116@brandon-blacks-computer (orig r3128): castaway | 2007-03-14 10:02:44 -0500 Added patch from Schwern to allow cdbi compat to infer the has_many from a has_a r27119@brandon-blacks-computer (orig r3129): castaway | 2007-03-16 11:04:07 -0500 Initial version of Manual::Joining r27120@brandon-blacks-computer (orig r3130): castaway | 2007-03-16 11:06:21 -0500 Add FAQ and Joining links to Manual.pod r27319@brandon-blacks-computer (orig r3148): blblack | 2007-03-29 08:42:27 -0500 fix for rt.cpan.org #25683 (DBD::Sybase/FreeTDS/MSSQL cannot have two open sths during column_info r27324@brandon-blacks-computer (orig r3153): blblack | 2007-03-29 09:13:17 -0500 backport Ash's quoting fix from Loader to columns_info_for r29666@brandon-blacks-computer (orig r3173): castaway | 2007-04-02 17:19:05 -0500 Add patch from dec to allow us to pick which sources to deploy r30330@brandon-blacks-computer (orig r3185): matthewt | 2007-04-09 15:41:34 -0500 add SQL::Abstract to search docs (patch from zamolxes) r30510@brandon-blacks-computer (orig r3189): blblack | 2007-04-13 19:09:32 -0500 fixed regex in t/76joins (was relying on a 5.8.8 bug that is fixed in bleadperl, so this test was failing on bleadperl) r30560@brandon-blacks-computer (orig r3196): marcus | 2007-04-16 07:55:44 -0500 Updated cookbook example r30589@brandon-blacks-computer (orig r3199): blblack | 2007-04-17 18:45:11 -0500 Changes list synced up through now r30590@brandon-blacks-computer (orig r3200): blblack | 2007-04-17 18:47:03 -0500 cleared up a Changes entry r30591@brandon-blacks-computer (orig r3201): blblack | 2007-04-17 19:21:01 -0500 0.07006 changes, version update r30607@brandon-blacks-computer (orig r3202): matthewt | 2007-04-18 21:29:05 -0500 reverting r3173, already implemented in -current r30709@brandon-blacks-computer (orig r3208): matthewt | 2007-04-24 17:04:02 -0500 oops. props to chapman for the spot r30762@brandon-blacks-computer (orig r3220): blblack | 2007-05-01 00:25:33 -0500 load-time performance improvements --- ca83d811f3ce60ebb819ce9ad54179837f6157c6 diff --cc Changes index c6d5249,ab676f1..3742a33 --- a/Changes +++ b/Changes @@@ -1,59 -1,31 +1,72 @@@ Revision history for DBIx::Class + - Added Oracle/WhereJoins.pm for Oracle >= 8 to support + Oracle <= 9i, and provide Oracle with a better join method for + later versions. (I use the term better loosely.) + - select et al weren't properly detecing when the server connection + had timed out when not in a transaction + - The SQL::T parser class now respects a relationship attribute of + is_foreign_key_constrain to allow explicit control over wether or + not a foreign constraint is needed + + 0.07006 2007-04-17 23:18:00 + - Lots of documentation updates + - deploy now takes an optional 'source_names' parameter (dec) + - Quoting for for columns_info_for + - RT#25683 fixed (multiple open sths on DBD::Sybase) + - CDBI compat infers has_many from has_a (Schwern) + - Fix ddl_filename transformation (Carl Vincent) + +0.07999_02 2007-01-25 20:11:00 + - add support for binding BYTEA and similar parameters (w/Pg impl) + - add support to Ordered for multiple ordering columns + - mark DB.pm and compose_connection as deprecated + - switch tests to compose_namespace + - ResltClass::HashRefInflator added + - Changed row and rs objects to not have direct handle to a source, + instead a (schema,source_name) tuple of type ResultSourceHandle + + 0.07005 2007-01-10 18:36:00 + - fixup changes file + - remove erroneous .orig files - oops + + 0.07004 2007-01-09 21:52:00 + - fix find_related-based queries to correctly grep the unique key + - fix InflateColumn to inflate/deflate all refs but scalar refs + + 0.07003 2006-11-16 11:52:00 + - fix for rt.cpan.org #22740 (use $^X instead of hardcoded "perl") + - Tweaks to resultset to allow inflate_result to return an array + - Fix UTF8Columns to work under Perl <= 5.8.0 + - Fix up new_result in ResultSet to avoid alias-related bugs + - Made new/update/find handle 'single' rel accessor correctly + - Fix NoBindVars to be safer and handle non-true bind values + - Don't blow up if columns_info_for returns useless results + - Documentation updates + +0.07999_01 2006-10-05 21:00:00 + - add connect_info option "disable_statement_caching" + - create insert_bulk using execute_array, populate uses it + - added DBIx::Class::Schema::load_namespaces, alternative to + load_classes + - added source_info method for source-level metadata (kinda like + column_info) + - Some of ::Storage::DBI's code/docs moved to ::Storage + - DBIx::Class::Schema::txn_do code moved to ::Storage + - Storage::DBI now uses exceptions instead of ->ping/->{Active} checks + - Storage exceptions are thrown via the schema class's throw_exception + - DBIx::Class::Schema::throw_exception's behavior can be modified via + ->exception_action + - columns_info_for is deprecated, and no longer runs automatically. + You can make it work like before via + __PACKAGE__->column_info_from_storage(1) for now + - Replaced DBIx::Class::AccessorGroup and Class::Data::Accessor with + Class::Accessor::Grouped. Only user noticible change is to + table_class on ResultSourceProxy::Table (i.e. table objects in + schemas) and, resultset_class and result_class in ResultSource. + These accessors no longer automatically require the classes when + set. + - 0.07004 - - fix find_related-based queries to correctly grep the unique key - - 0.07003 2006-11-16 11:52:00 - - fix for rt.cpan.org #22740 (use $^X instead of hardcoded "perl") - - Tweaks to resultset to allow inflate_result to return an array - - Fix UTF8Columns to work under Perl <= 5.8.0 - - Fix up new_result in ResultSet to avoid alias-related bugs - - Made new/update/find handle 'single' rel accessor correctly - - Fix NoBindVars to be safer and handle non-true bind values - - Don't blow up if columns_info_for returns useless results - - Documentation updates - 0.07002 2006-09-14 21:17:32 - fix quote tests for recent versions of SQLite - added reference implementation of Manual::Example diff --cc MANIFEST.SKIP index 9184f2a,fa93767..b174c1d --- a/MANIFEST.SKIP +++ b/MANIFEST.SKIP @@@ -41,5 -40,5 +41,8 @@@ # Skip maint stuff ^maint/ + # Avoid copies to .orig + \.orig$ ++ +# Dont use Module::Build anymore +# Build.PL diff --cc lib/DBIx/Class/Ordered.pm index d5a7a00,35ceba4..737477d --- a/lib/DBIx/Class/Ordered.pm +++ b/lib/DBIx/Class/Ordered.pm @@@ -17,28 -17,9 +17,28 @@@ Create a table for your ordered data name TEXT NOT NULL, position INTEGER NOT NULL ); - # Optional: group_id INTEGER NOT NULL + +Optionally, add one or more columns to specify groupings, allowing you +to maintain independent ordered lists within one table: + + CREATE TABLE items ( + item_id INTEGER PRIMARY KEY AUTOINCREMENT, + name TEXT NOT NULL, + position INTEGER NOT NULL, + group_id INTEGER NOT NULL + ); + +Or even + + CREATE TABLE items ( + item_id INTEGER PRIMARY KEY AUTOINCREMENT, + name TEXT NOT NULL, + position INTEGER NOT NULL, + group_id INTEGER NOT NULL, + other_group_id INTEGER NOT NULL + ); - In your Schema or DB class add Ordered to the top + In your Schema or DB class add "Ordered" to the top of the component list. __PACKAGE__->load_components(qw( Ordered ... )); @@@ -48,16 -29,9 +48,16 @@@ each row package My::Item; __PACKAGE__->position_column('position'); - __PACKAGE__->grouping_column('group_id'); # optional + +If you are using one grouping column, specify it as follows: + + __PACKAGE__->grouping_column('group_id'); + +Or if you have multiple grouping columns: + + __PACKAGE__->grouping_column(['group_id', 'other_group_id']); - Thats it, now you can change the position of your objects. + That's it, now you can change the position of your objects. #!/use/bin/perl use My::Item; diff --cc lib/DBIx/Class/Schema.pm index 4478d6f,5f69862..2913a2f --- a/lib/DBIx/Class/Schema.pm +++ b/lib/DBIx/Class/Schema.pm @@@ -94,20 -91,11 +94,16 @@@ moniker sub register_source { my ($self, $moniker, $source) = @_; + + %$source = %{ $source->new( { %$source, source_name => $moniker }) }; + - my %reg = %{$self->source_registrations}; - $reg{$moniker} = $source; - $self->source_registrations(\%reg); + $self->source_registrations->{$moniker} = $source; + $source->schema($self); + weaken($source->{schema}) if ref($self); if ($source->result_class) { - my %map = %{$self->class_mappings}; - $map{$source->result_class} = $moniker; - $self->class_mappings(\%map); + $self->class_mappings->{$source->result_class} = $moniker; } } @@@ -1004,12 -778,11 +997,12 @@@ format =cut sub ddl_filename { - my ($self, $type, $dir, $version) = @_; + my ($self, $type, $dir, $version, $pversion) = @_; my $filename = ref($self); - $filename =~ s/::/-/; + $filename =~ s/::/-/g; - $filename = "$dir$filename-$version-$type.sql"; + $filename = File::Spec->catfile($dir, "$filename-$version-$type.sql"); + $filename =~ s/$version/$pversion-$version/ if($pversion); return $filename; }