DBH/Sybase.pm untested

filter: Statementstmt 0.0% 0 / 18 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 24 CC 2 SCAR 13.9
CC
2
Cov
0%
connect_data
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 4.0
1 package DBIx::DBH::Sybase;
2
3 use base qw(DBIx::DBH);
4 use Params::Validate qw( :all );
5
6 my @optional_ = qw(
7 syb_show_sql
8 syb_show_eed
9 syb_err_handler
10 syb_flush_finish
11 syb_dynamic_supported
12 syb_chained_txn
13 syb_quoted_identifier
14 syb_rowcount
15 syb_do_proc_status
16 syb_use_bin_0x
17 syb_binary_images
18 syb_oc_version
19 syb_server_version
20 syb_server_version_string
21 syb_failed_db_fatal
22 syb_no_child_con
23 syb_bind_empty_string_as_null
24 syb_cancel_request_on_error
25 syb_date_fmt
26 );
27
28 sub connect_data {
29
30 my $class = shift;
31
32 my %p = @_;
33
34 %p = validate( @_, { driver => { type => SCALAR },
35 dbname => { type => SCALAR},
36 database => { type => SCALAR | UNDEF,
37 optional => 1},
38 user => { type => SCALAR | UNDEF,
39 optional => 1 },
40 password => { type => SCALAR | UNDEF,
41 optional => 1 },
42 host => { type => SCALAR | UNDEF,
43 optional => 1 },
44 maxConnect => { type => SCALAR | UNDEF,
45 optional => 1 },
46 language => { type => SCALAR | UNDEF,
47 optional => 1 },
48 charset => { type => SCALAR | UNDEF,
49 optional => 1 },
50 packetSize => { type => SCALAR | UNDEF,
51 optional => 1 },
52 interfaces => { type => SCALAR | UNDEF,
53 optional => 1 },
54 timeout => { type => SCALAR | UNDEF,
55 optional => 1 },
56 loginTimeout => { type => SCALAR | UNDEF,
57 optional => 1 },
58 scriptName => { type => SCALAR | UNDEF,
59 optional => 1 },
60 hostname => { type => SCALAR | UNDEF,
61 optional => 1 },
62 tdsLevel => { type => SCALAR | UNDEF,
63 optional => 1 },
64 encryptPassword => { type => SCALAR | UNDEF,
65 optional => 1 },
66 kerberos => { type => SCALAR | UNDEF,
67 optional => 1 },
68
69 sslCAFile => { type => SCALAR | UNDEF,
70 optional => 1 },
71 bulkLogin => { type => SCALAR | UNDEF,
72 optional => 1 },
73 port => { type => SCALAR | UNDEF,
74 optional => 1 },
75
76 map { $_ => 0 } (@optional_, @DBIx::DBH::attr)
77 } );
78
79 my $dsn = "dbi:$p{driver}:server=$p{host}";
80
81 # optional DSN configuration options.
82 foreach ( qw(port database maxConnect language charset packetSize interfaces timeout loginTimeout scriptName hostname tdsLevel encryptPassword kerberos sslCAFile bulkLogin))
83 {
84 $dsn .= ";$_=$p{$_}" if (defined $p{$_});
85 }
86
87 # attributes that get passed in via an anonymous hash to the connect routine.
88 foreach my $k ( grep { /^syb_/ } sort keys %p )
89 {
90 $p{attr}{$k} = $p{$k};
91 }
92
93 ($dsn, $p{user}, $p{password}, $p{attr});
94
95 }
96
97
98
99 1;
100
101 =head1 NAME
102
103 DBIx::DBH::Sybase - Sybase DBI database handle connection specifics.
104
105 =head1 connect()
106
107 L<DBIx::DBH> covered the options available to any database driver as
108 specified in L<DBI>. Here we
109 list optional arguments supported by Sybase. Please read L<DBD::Sybase> for
110 details
111
112 =head2 DSN options
113
114 =over 4
115
116 =item * maxConnect
117
118 =item * language
119
120 =item * charset
121
122 =item * packetSize
123
124 =item * interfaces
125
126 =item * timeout
127
128 =item * loginTimeout
129
130 =item * scriptName
131
132 =item * hostname
133
134 =item * tdsLevel
135
136 =item * encryptPassword
137
138 =item * kerberos
139
140 =item * sslCAFile
141
142 =item * bulkLogin
143
144
145 =back
146
147 =head2 Database handle attributes
148
149 =over 4
150
151
152 =item * syb_show_sql
153
154 =item * syb_show_eed
155
156 =item * syb_err_handler
157
158 =item * syb_flush_finish
159
160 =item * syb_dynamic_supported
161
162 =item * syb_chained_txn
163
164 =item * syb_quoted_identifier
165
166 =item * syb_rowcount
167
168 =item * syb_do_proc_status
169
170 =item * syb_use_bin_0x
171
172 =item * syb_binary_images
173
174 =item * syb_oc_version
175
176 =item * syb_server_version
177
178 =item * syb_failed_db_fatal
179
180 =item * syb_no_child_con
181
182 =item * syb_bind_empty_string_as_null
183
184 =item * syb_cancel_request_on_error
185
186 =item * syb_date_fmt
187
188 =back
189
190 =head1 SEE_ALSO
191
192 L<DBD::Sybase> to see what all of these options do.
193
194 =cut