line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DBIx::Class::Schema::SQLA2Support; |
2
|
4
|
|
|
4
|
|
769150
|
use strict; |
|
4
|
|
|
|
|
27
|
|
|
4
|
|
|
|
|
114
|
|
3
|
4
|
|
|
4
|
|
22
|
use warnings; |
|
4
|
|
|
|
|
20
|
|
|
4
|
|
|
|
|
102
|
|
4
|
4
|
|
|
4
|
|
32
|
use parent 'DBIx::Class::Schema'; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
45
|
|
5
|
|
|
|
|
|
|
__PACKAGE__->mk_classdata('sqla2_subclass'); |
6
|
|
|
|
|
|
|
__PACKAGE__->mk_classdata('sqla2_rebase_immediately'); |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub connection { |
9
|
9
|
|
|
9
|
1
|
59605
|
my ($self, @info) = @_; |
10
|
9
|
|
|
|
|
62
|
$self->next::method(@info); |
11
|
|
|
|
|
|
|
my $connect = sub { |
12
|
10
|
|
50
|
10
|
|
170130
|
shift->connect_call_rebase_sqlmaker($self->sqla2_subclass || 'DBIx::Class::SQLA2'); |
13
|
9
|
|
|
|
|
314960
|
}; |
14
|
9
|
50
|
|
|
|
193
|
if (my $calls = $self->storage->on_connect_call) { |
15
|
0
|
|
|
|
|
0
|
$self->storage->on_connect_call([ $connect, $calls ]); |
16
|
|
|
|
|
|
|
} else { |
17
|
9
|
|
|
|
|
1114
|
$self->storage->on_connect_call([$connect]); |
18
|
|
|
|
|
|
|
} |
19
|
9
|
100
|
|
|
|
357
|
$connect->($self->storage) if ($self->sqla2_rebase_immediately); |
20
|
9
|
|
|
|
|
1507
|
return $self; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=encoding utf8 |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 NAME |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
DBIx::Class::Schema::SQLA2Support - SQL::Abstract v2 support in DBIx::Class::Schema |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 SYNOPSIS |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
# schema code |
34
|
|
|
|
|
|
|
package MyApp::Schema; |
35
|
|
|
|
|
|
|
use strict; |
36
|
|
|
|
|
|
|
use warnings; |
37
|
|
|
|
|
|
|
use base qw/DBIx::Class::Schema/; |
38
|
|
|
|
|
|
|
__PACKAGE__->load_components('Schema::SQLA2Support'); |
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
# client code |
42
|
|
|
|
|
|
|
my $schema = MyApp::Schema->connect( ... ); |
43
|
|
|
|
|
|
|
$schema->sqla2_subclass('DBIx::Class::SQLA2'); |
44
|
|
|
|
|
|
|
$schema->sqla2_rebase_immediately(1); |
45
|
|
|
|
|
|
|
my $rs = $schema->resultset('Album')->search(undef, {'!with' => [ ... ]}); |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 DESCRIPTION |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
This is a work in progress for simplifying using SQLA2 with DBIC. This is for using w/ the |
50
|
|
|
|
|
|
|
most recent version of DBIC. |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
B |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=cut |