Codebase list libdbix-class-perl / 0e55683
Update upstream source from tag 'upstream/0.082843' Update to upstream version '0.082843' with Debian dir 5447532b81988c58d846844aafd9b0f747c9a6f8 gregor herrmann 1 year, 11 months ago
15 changed file(s) with 47 addition(s) and 30 deletion(s). Raw diff Collapse all Expand all
110110 kkane: Kevin L. Kane <kevin.kane@gmail.com>
111111 konobi: Scott McWhirter <konobi@cpan.org>
112112 lejeunerenard: Sean Zellmer <sean@lejeunerenard.com>
113 leont: Leon Timmermans <fawaka@gmail.com>
113114 littlesavage: Alexey Illarionov <littlesavage@orionet.ru>
114115 lukes: Luke Saunders <luke.saunders@gmail.com>
115116 marcus: Marcus Ramberg <mramberg@cpan.org>
00 Revision history for DBIx::Class
1
2 0.082843 2022-05-17 10:50 (UTC)
3 * Fixes
4 - Adjust tests to account for DBD::SQLite's column_info() no longer
5 being case-preserving in recent versions
6 - Fix t/storage/replicated.t relying on no-longer-available module
7 - Adjust t/53lean_startup.t to work around spurious changes in
8 Perl5 core (GH#143)
19
210 0.082842 2020-06-16 20:10 (UTC)
311 * New Features
0 DBIx::Class is Copyright (c) 2005-2020 by mst, castaway, ribasushi, and others.
0 DBIx::Class is Copyright (c) 2005-2022 by mst, castaway, ribasushi, and others.
11 See AUTHORS and LICENSE included with this distribution. All rights reserved.
22
33 This is free software; you can redistribute it and/or modify it under the
6161 bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=DBIx-Class
6262 license: http://dev.perl.org/licenses/
6363 repository: https://github.com/Perl5/DBIx-Class
64 version: 0.082842
64 version: 0.082843
6565 x_authority: cpan:RIBASUSHI
6666 x_contributors:
6767 - 'abraxxa: Alexander Hartmaier <abraxxa@cpan.org>'
166166 - 'kkane: Kevin L. Kane <kevin.kane@gmail.com>'
167167 - 'konobi: Scott McWhirter <konobi@cpan.org>'
168168 - 'lejeunerenard: Sean Zellmer <sean@lejeunerenard.com>'
169 - 'leont: Leon Timmermans <fawaka@gmail.com>'
169170 - 'littlesavage: Alexey Illarionov <littlesavage@orionet.ru>'
170171 - 'lukes: Luke Saunders <luke.saunders@gmail.com>'
171172 - 'marcus: Marcus Ramberg <mramberg@cpan.org>'
0 DBIx::Class is Copyright (c) 2005-2020 by mst, castaway, ribasushi, and others.
0 DBIx::Class is Copyright (c) 2005-2022 by mst, castaway, ribasushi, and others.
11 See AUTHORS and LICENSE included with this distribution. All rights reserved.
22
33 NAME
190190 questions and suggestions have been shown to catalyze monumental
191191 improvements in consistency, accuracy and performance.
192192
193 List of the awesome contributors who made DBIC v0.082842 possible
193 List of the awesome contributors who made DBIC v0.082843 possible
194194
195195 abraxxa: Alexander Hartmaier <abraxxa@cpan.org>
196196
395395 konobi: Scott McWhirter <konobi@cpan.org>
396396
397397 lejeunerenard: Sean Zellmer <sean@lejeunerenard.com>
398
399 leont: Leon Timmermans <fawaka@gmail.com>
398400
399401 littlesavage: Alexey Illarionov <littlesavage@orionet.ru>
400402
22
33 use strict;
44 use warnings;
5
6 #use base qw/Class::Accessor/;
75
86 sub get {
97 my ($self, @cols) = @_;
1717
1818 ...
1919
20 configure_requires 'DBIx::Class' => '0.082842';
20 configure_requires 'DBIx::Class' => '0.082843';
2121
2222 require DBIx::Class::Optional::Dependencies;
2323
1010 # $VERSION declaration must stay up here, ahead of any other package
1111 # declarations, as to not confuse various modules attempting to determine
1212 # this ones version, whether that be s.c.o. or Module::Metadata, etc
13 $VERSION = '0.082842';
13 $VERSION = '0.082843';
1414
1515 {
1616 package
208208 the seemingly most insignificant questions and suggestions have been shown
209209 to catalyze monumental improvements in consistency, accuracy and performance.
210210
211 List of the awesome contributors who made DBIC v0.082842 possible
211 List of the awesome contributors who made DBIC v0.082843 possible
212212
213213 =encoding utf8
214214
417417 B<konobi>: Scott McWhirter <konobi@cpan.org>
418418
419419 B<lejeunerenard>: Sean Zellmer <sean@lejeunerenard.com>
420
421 B<leont>: Leon Timmermans <fawaka@gmail.com>
420422
421423 B<littlesavage>: Alexey Illarionov <littlesavage@orionet.ru>
422424
2929 # exclude our test suite, known "module require-rs" and eval frames
3030 $caller[1] =~ /^ t [\/\\] /x
3131 or
32 $caller[0] =~ /^ (?: base | parent | Class::C3::Componentised | Module::Inspector | Module::Runtime ) $/x
32 $caller[0] =~ /^ (?: base | parent | Class::C3::Componentised | Module::Inspector | Module::Runtime ) $/x && $caller[3] !~ m/::BEGIN$/
3333 or
3434 $caller[3] eq '(eval)',
3535 )
33 use Test::More;
44 use Test::Exception;
55 use Test::Warn;
6 use Test::Deep;
67 use lib qw(t/lib);
78 use DBICTest ':DiffSQL';
89
386387 $schema->source("Artist")->column_info_from_storage(1);
387388 $schema->source("Artist")->{_columns_info_loaded} = 0;
388389
389 is_deeply (
390 cmp_deeply (
390391 $schema->source('Artist')->columns_info,
391392 {
392393 artistid => {
409410 size => 100
410411 },
411412 rank => {
412 data_type => "integer",
413 data_type => re(qr/^integer$/i),
413414 default_value => 13,
414415 is_nullable => 0,
415416 size => undef
420421
421422 ok($schema->source("Artist")->{_columns_info_loaded} == 1, 'Columns info loaded flag set');
422423
423 is_deeply (
424 cmp_deeply (
424425 $schema->source('Artist')->columns_info([qw/artistid rank/]),
425426 {
426427 artistid => {
430431 size => undef
431432 },
432433 rank => {
433 data_type => "integer",
434 data_type => re(qr/^integer$/i),
434435 default_value => 13,
435436 is_nullable => 0,
436437 size => undef
11 use warnings;
22
33 use Test::More;
4 use Test::Deep;
45 use lib qw(t/lib);
56 use DBICTest;
67
4748 );
4849
4950 {
50 is_deeply (
51 cmp_deeply (
5152 get_storage_column_info ($schema->storage, 'artist', qw/size/),
5253 {
5354 'artistid' => {
5960 'is_nullable' => 1,
6061 },
6162 'rank' => {
62 'data_type' => 'integer',
63 'data_type' => re(qr/^integer$/i),
6364 'is_nullable' => 0,
6465 'default_value' => '13',
6566 },
2020
2121 ok(!defined $cd[0]->liner_notes, 'No prefetch for NULL LEFT join');
2222
23 is($cd[1]->{_relationship_data}{liner_notes}->notes, 'Buy Whiskey!', 'Prefetch for present LEFT JOIN');
23 is($cd[1]->liner_notes->notes, 'Buy Whiskey!', 'Prefetch for present LEFT JOIN');
2424
2525 is(ref $cd[1]->liner_notes, 'DBICTest::LinerNotes', 'Prefetch returns correct class');
2626
27 is($cd[2]->{_inflated_column}{artist}->name, 'Caterwauler McCrae', 'Prefetch on parent object ok');
27 is($cd[2]->artist->name, 'Caterwauler McCrae', 'Prefetch on parent object ok');
2828 }, 1, 'prefetch ran only 1 select statement');
2929
3030 # test for partial prefetch via columns attr
31 my $cd = $schema->resultset('CD')->find(1,
31 my $cd;
32 $schema->is_executed_querycount( sub {
33 $cd = $schema->resultset('CD')->find(1,
3234 {
3335 columns => [qw/title artist artist.name/],
3436 join => { 'artist' => {} }
3537 }
36 );
37 is( $cd->artist->name, 'Caterwauler McCrae', 'single related column prefetched');
38 );
39 is( $cd->artist->name, 'Caterwauler McCrae', 'single related column prefetched');
40 }, 1, 'manual prefetch ran only 1 select statement');
3841
3942 # start test for nested prefetch SELECT count
4043 my $tag;
6467 $schema->is_executed_querycount( sub {
6568 $cd = $schema->resultset('CD')->find(1, { prefetch => 'artist' });
6669
67 is($cd->{_inflated_column}{artist}->name, 'Caterwauler McCrae', 'artist prefetched correctly on find');
68 }, 1, 'find with prefetch ran exactly 1 select statement (excluding column_info)');
70 is($cd->artist->name, 'Caterwauler McCrae', 'artist prefetched correctly on find');
71 }, 1, 'find with prefetch ran exactly 1 select statement');
6972
7073 $schema->is_executed_querycount( sub {
7174 $cd = $schema->resultset('CD')->find(1, { prefetch => { cd_to_producer => 'producer' }, order_by => 'producer.producerid' });
7575 package DBIx::Class::DBI::Replicated::TestReplication;
7676
7777 use DBICTest;
78 use base qw/Class::Accessor::Fast/;
79
80 __PACKAGE__->mk_accessors( qw/schema/ );
78 use base 'Class::Accessor::Grouped';
79
80
81 __PACKAGE__->mk_group_accessors( simple => 'schema' );
8182
8283 ## Initialize the object
8384
8485 sub new {
8586 my ($class, $schema_method) = (shift, shift);
86 my $self = $class->SUPER::new(@_);
87 my $self = bless( (shift || {}), $class );
8788
8889 $self->schema( $self->init_schema($schema_method) );
8990 return $self;
147148 use File::Copy;
148149 use base 'DBIx::Class::DBI::Replicated::TestReplication';
149150
150 __PACKAGE__->mk_accessors(qw/master_path slave_paths/);
151 __PACKAGE__->mk_group_accessors( simple => qw( master_path slave_paths ) );
151152
152153 ## Set the master path from DBICTest
153154
154155 sub new {
155 my $class = shift @_;
156 my $self = $class->SUPER::new(@_);
156 my $self = shift->next::method(@_);
157157
158158 $self->master_path( DBICTest->_sqlite_dbfilename );
159159 $self->slave_paths([