DBIx-Class-Schema-Loader

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
0.03001  Mon Jun  5 23:17:57 UTC 2006
        - load_from_connection deprecation notice now mentions
          upgrading Catalyst::Model::DBIC::Schema if that module
          seems to be in use.
        - DBIx::Class required version number fixed
        - Loader statement caching for better load-time performance
        - Improved Pg unique index loader, based on RDBO
 
0.03000  Tue May 23 12:56:05 UTC 2006
        - weakened the circular schema reference
 
0.02999_10  Mon May 22 18:58:20 UTC 2006
        - a few more small bugfixes
        - more dump/debug improvements
        - new exportable function "make_schema_at"
 
0.02999_09  Sun May 21 23:26:58 UTC 2006
        - More docs improvements
        - default uniq_info just warns and returns nothing now,
          instead of dying.  In theory, this allows unsupported

lib/DBIx/Class/Schema/Loader.pm  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
 
use strict;
use base qw/https://metacpan.org/pod/DBIx::Class::Schema">DBIx::Class::Schema Class::Accessor::Grouped/;
use mro 'c3';
use Carp::Clan qw/^DBIx::Class/;
use Scalar::Util 'weaken';
use Sub::Util 'set_subname';
use DBIx::Class::Schema::Loader::Utils qw/array_eq sigwarn_silencer/;
use curry;
 
# 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
our $VERSION = '0.07053';

lib/DBIx/Class/Schema/Loader.pm  view on Meta::CPAN

390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
=cut
 
sub clone {
    my $self = shift;
 
    my $clone = $self->next::method(@_);
 
    if($clone->_loader_args) {
        $clone->_loader_args->{schema} = $clone;
        weaken($clone->_loader_args->{schema});
    }
 
    $clone;
}
 
=head2 dump_to_dir
 
=over 4
 
=item Argument: $directory

lib/DBIx/Class/Schema/Loader/Column.pm  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
 
use strict;
use mro 'c3';
use Carp::Clan qw/^DBIx::Class/;
use Scalar::Util 'weaken';
 
=head1 NAME
 
DBIx::Class::Schema::Loader::Column - Class for Columns in
L<DBIx::Class::Schema::Loader>
 
=head1 DESCRIPTION
 
Used for representing columns in

lib/DBIx/Class/Schema/Loader/Column.pm  view on Meta::CPAN

41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
The constructor. Takes L</table> and L</name> key-value parameters.
 
=cut
 
sub new {
    my $class = shift;
 
    my $self = { @_ };
    croak "table is required" unless ref $self->{table};
 
    weaken $self->{table};
 
    return bless $self, $class;
}
 
=head2 table
 
The L</DBIx::Class::Schema::Loader::Table> object this column belongs to.
Required parameter for L</new>
 
=head2 name

lib/DBIx/Class/Schema/Loader/DBObject.pm  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
 
use strict;
use mro 'c3';
use Carp::Clan qw/^DBIx::Class/;
use Scalar::Util 'weaken';
 
=head1 NAME
 
DBIx::Class::Schema::Loader::DBObject - Base Class for Database Objects Such as
Tables and Views in L<DBIx::Class::Schema::Loader>
 
=head1 METHODS
 
=head2 loader

lib/DBIx/Class/Schema/Loader/DBObject.pm  view on Meta::CPAN

45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
=cut
 
sub new {
    my $class = shift;
 
    my $self = { @_ };
 
    croak "loader is required" unless ref $self->{loader};
 
    weaken $self->{loader};
 
    $self->{_schema} = delete $self->{schema};
 
    return bless $self, $class;
}
 
=head2 clone
 
Make a shallow copy of the object.

lib/DBIx/Class/Schema/Loader/RelBuilder.pm  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
 
use strict;
use mro 'c3';
use Carp::Clan qw/^DBIx::Class/;
use Scalar::Util 'weaken';
use DBIx::Class::Schema::Loader::Utils qw/split_name slurp_file array_eq apply uniq/;
use List::Util qw/all any first/;

lib/DBIx/Class/Schema/Loader/RelBuilder.pm  view on Meta::CPAN

137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
my $self = {
    loader             => $loader,
    (map { $_ => $loader->$_ } qw(
        schema inflect_plural inflect_singular
        relationship_attrs rel_collision_map
        rel_name_map allow_extra_m2m_cols
    )),
    _temp_classes      => [],
};
 
weaken $self->{loader}; #< don't leak
 
bless $self => $class;
 
# validate the relationship_attrs arg
if( defined $self->relationship_attrs ) {
    (ref $self->relationship_attrs eq 'HASH' || ref $self->relationship_attrs eq 'CODE')
        or croak "relationship_attrs must be a hashref or coderef";
}
 
return $self;

t/backcompat/0.04006/lib/dbixcsl_test_dir.pm  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
 
use strict;
use File::Path 'rmtree';
use File::Temp 'tempdir';
use Scalar::Util 'weaken';
use DBI ();
 
our @EXPORT_OK = '$tdir';
 
die "/t does not exist, this can't be right...\n"
    unless -d 't';
 
my $tbdir = 't/var';

t/backcompat/0.04006/lib/dbixcsl_test_dir.pm  view on Meta::CPAN

28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
no warnings 'redefine';
 
my $connect = \&DBI::connect;
 
my @handles;
 
*DBI::connect = sub {
    my $dbh = $connect->(@_);
    push @handles, $dbh;
    weaken $handles[-1];
    return $dbh;
};
 
END {
    if (not $ENV{SCHEMA_LOADER_TESTS_NOCLEANUP}) {
        foreach my $dbh (@handles) {
            $dbh->disconnect if $dbh;
        }
 
        rmtree($tdir, 1, 1);

t/lib/dbixcsl_test_dir.pm  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
 
use strict;
use File::Path 'rmtree';
use File::Temp 'tempdir';
use Scalar::Util 'weaken';
use DBI ();
 
our @EXPORT_OK = '$tdir';
 
die "/t does not exist, this can't be right...\n"
    unless -d 't';
 
my $tbdir = 't/var';

t/lib/dbixcsl_test_dir.pm  view on Meta::CPAN

28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
no warnings 'redefine';
 
my $connect = \&DBI::connect;
 
my @handles;
 
*DBI::connect = sub {
    my $dbh = $connect->(@_);
    push @handles, $dbh;
    weaken $handles[-1];
    return $dbh;
};
 
END {
    if (not $ENV{SCHEMA_LOADER_TESTS_NOCLEANUP}) {
        foreach my $dbh (@handles) {
            $dbh->disconnect if $dbh;
        }
 
        rmtree($tdir, 1, 1);



( run in 0.653 second using v1.01-cache-2.11-cpan-26ccb49234f )