line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
use strict; |
2
|
72
|
|
|
72
|
|
105067
|
use warnings; |
|
72
|
|
|
|
|
149
|
|
|
72
|
|
|
|
|
1812
|
|
3
|
72
|
|
|
72
|
|
323
|
use Teng::Row; |
|
72
|
|
|
|
|
118
|
|
|
72
|
|
|
|
|
2141
|
|
4
|
72
|
|
|
72
|
|
1965
|
use Class::Accessor::Lite |
|
72
|
|
|
|
|
136
|
|
|
72
|
|
|
|
|
1868
|
|
5
|
|
|
|
|
|
|
rw => [ qw( |
6
|
72
|
|
|
|
|
486
|
tables |
7
|
|
|
|
|
|
|
namespace |
8
|
|
|
|
|
|
|
) ] |
9
|
|
|
|
|
|
|
; |
10
|
72
|
|
|
72
|
|
1535
|
|
|
72
|
|
|
|
|
3117
|
|
11
|
|
|
|
|
|
|
my ($class, %args) = @_; |
12
|
|
|
|
|
|
|
bless { |
13
|
77
|
|
|
77
|
1
|
276
|
tables => {}, |
14
|
77
|
|
|
|
|
447
|
namespace => '', |
15
|
|
|
|
|
|
|
%args, |
16
|
|
|
|
|
|
|
}, $class; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
my ($class, $instance) = @_; |
20
|
|
|
|
|
|
|
no strict 'refs'; |
21
|
|
|
|
|
|
|
no warnings 'once'; |
22
|
72
|
|
|
72
|
1
|
208
|
${"$class\::DEFAULT_INSTANCE"} = $instance; |
23
|
72
|
|
|
72
|
|
9227
|
} |
|
72
|
|
|
|
|
120
|
|
|
72
|
|
|
|
|
2142
|
|
24
|
72
|
|
|
72
|
|
359
|
|
|
72
|
|
|
|
|
145
|
|
|
72
|
|
|
|
|
5533
|
|
25
|
72
|
|
|
|
|
131
|
my $class = shift; |
|
72
|
|
|
|
|
400
|
|
26
|
|
|
|
|
|
|
no strict 'refs'; |
27
|
|
|
|
|
|
|
no warnings 'once'; |
28
|
|
|
|
|
|
|
${"$class\::DEFAULT_INSTANCE"}; |
29
|
582
|
|
|
582
|
1
|
846
|
} |
30
|
72
|
|
|
72
|
|
403
|
|
|
72
|
|
|
|
|
149
|
|
|
72
|
|
|
|
|
2165
|
|
31
|
72
|
|
|
72
|
|
380
|
my ($self, $table) = @_; |
|
72
|
|
|
|
|
125
|
|
|
72
|
|
|
|
|
20507
|
|
32
|
582
|
|
|
|
|
1712
|
$self->{tables}->{$table->name} = $table; |
|
582
|
|
|
|
|
3508
|
|
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
my ($self, $name) = @_; |
36
|
247
|
|
|
247
|
1
|
474
|
return unless $name; |
37
|
247
|
|
|
|
|
622
|
$self->{tables}->{$name}; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
my ($self, $table_name) = @_; |
41
|
522
|
|
|
522
|
1
|
15605
|
|
42
|
522
|
100
|
|
|
|
1092
|
my $table = $self->{tables}->{$table_name}; |
43
|
521
|
|
|
|
|
1706
|
return $table->{row_class} if $table; |
44
|
|
|
|
|
|
|
return 'Teng::Row'; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
72
|
|
|
72
|
1
|
12602
|
my $s = shift; |
48
|
|
|
|
|
|
|
join('', map{ ucfirst $_ } split(/(?<=[A-Za-z])_(?=[A-Za-z])|\b/, $s)); |
49
|
72
|
|
|
|
|
162
|
} |
50
|
72
|
100
|
|
|
|
383
|
|
51
|
3
|
|
|
|
|
14
|
my ($self, $dbh) = @_; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
$_->prepare_from_dbh($dbh) for values %{$self->{tables}}; |
54
|
|
|
|
|
|
|
} |
55
|
246
|
|
|
246
|
1
|
358
|
|
56
|
246
|
|
|
|
|
1732
|
1; |
|
710
|
|
|
|
|
2363
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 NAME |
60
|
144
|
|
|
144
|
0
|
473
|
|
61
|
|
|
|
|
|
|
Teng::Schema - Schema API for Teng |
62
|
144
|
|
|
|
|
223
|
|
|
144
|
|
|
|
|
1098
|
|
63
|
|
|
|
|
|
|
=head1 METHODS |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=over 4 |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=item $schema = Teng::Schema->new |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
create new Teng::Schema's object. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=item $schema = Teng::Schema->instance |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
Get Teng::Schema's default instance object, was set by C<< Teng::Schema->set_default_instance() >>. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=item Teng::Schema->set_default_instance($schema) |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
set default Schema instance. |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=item $schema->add_table($table); |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
add Teng::Schema::Table's object. |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=item my $table = $schema->get_table($table_name); |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
get Teng::Schema::Table's object. |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=item my $row_class = $schema->get_row_class($table_name); |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
get your table row class or Teng::Row class. |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=item $schema->camelize($string) |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
convert from under_score text to CamelCase one. |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=back |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=cut |
98
|
|
|
|
|
|
|
|