added common test executing ...
|
1 |
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 |
2 |
.\" |
|
3 |
.\" Standard preamble: |
|
4 |
.\" ======================================================================== |
|
5 |
.de Sh \" Subsection heading |
|
6 |
.br |
|
7 |
.if t .Sp |
|
8 |
.ne 5 |
|
9 |
.PP |
|
10 |
\fB\\$1\fR |
|
11 |
.PP |
|
12 |
.. |
|
13 |
.de Sp \" Vertical space (when we can't use .PP) |
|
14 |
.if t .sp .5v |
|
15 |
.if n .sp |
|
16 |
.. |
|
17 |
.de Vb \" Begin verbatim text |
|
18 |
.ft CW |
|
19 |
.nf |
|
20 |
.ne \\$1 |
|
21 |
.. |
|
22 |
.de Ve \" End verbatim text |
|
23 |
.ft R |
|
24 |
.fi |
|
25 |
.. |
|
26 |
.\" Set up some character translations and predefined strings. \*(-- will |
|
27 |
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left |
|
28 |
.\" double quote, and \*(R" will give a right double quote. | will give a |
|
29 |
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to |
|
30 |
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' |
|
31 |
.\" expand to `' in nroff, nothing in troff, for use with C<>. |
|
32 |
.tr \(*W-|\(bv\*(Tr |
|
33 |
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' |
|
34 |
.ie n \{\ |
|
35 |
. ds -- \(*W- |
|
36 |
. ds PI pi |
|
37 |
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch |
|
38 |
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch |
|
39 |
. ds L" "" |
|
40 |
. ds R" "" |
|
41 |
. ds C` "" |
|
42 |
. ds C' "" |
|
43 |
'br\} |
|
44 |
.el\{\ |
|
45 |
. ds -- \|\(em\| |
|
46 |
. ds PI \(*p |
|
47 |
. ds L" `` |
|
48 |
. ds R" '' |
|
49 |
'br\} |
|
50 |
.\" |
|
51 |
.\" If the F register is turned on, we'll generate index entries on stderr for |
|
52 |
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index |
|
53 |
.\" entries marked with X<> in POD. Of course, you'll have to process the |
|
54 |
.\" output yourself in some meaningful fashion. |
|
55 |
.if \nF \{\ |
|
56 |
. de IX |
|
57 |
. tm Index:\\$1\t\\n%\t"\\$2" |
|
58 |
.. |
|
59 |
. nr % 0 |
|
60 |
. rr F |
|
61 |
.\} |
|
62 |
.\" |
|
63 |
.\" For nroff, turn off justification. Always turn off hyphenation; it makes |
|
64 |
.\" way too many mistakes in technical documents. |
|
65 |
.hy 0 |
|
66 |
.if n .na |
|
67 |
.\" |
|
68 |
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). |
|
69 |
.\" Fear. Run. Save yourself. No user-serviceable parts. |
|
70 |
. \" fudge factors for nroff and troff |
|
71 |
.if n \{\ |
|
72 |
. ds #H 0 |
|
73 |
. ds #V .8m |
|
74 |
. ds #F .3m |
|
75 |
. ds #[ \f1 |
|
76 |
. ds #] \fP |
|
77 |
.\} |
|
78 |
.if t \{\ |
|
79 |
. ds #H ((1u-(\\\\n(.fu%2u))*.13m) |
|
80 |
. ds #V .6m |
|
81 |
. ds #F 0 |
|
82 |
. ds #[ \& |
|
83 |
. ds #] \& |
|
84 |
.\} |
|
85 |
. \" simple accents for nroff and troff |
|
86 |
.if n \{\ |
|
87 |
. ds ' \& |
|
88 |
. ds ` \& |
|
89 |
. ds ^ \& |
|
90 |
. ds , \& |
|
91 |
. ds ~ ~ |
|
92 |
. ds / |
|
93 |
.\} |
|
94 |
.if t \{\ |
|
95 |
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" |
|
96 |
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' |
|
97 |
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' |
|
98 |
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' |
|
99 |
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' |
|
100 |
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' |
|
101 |
.\} |
|
102 |
. \" troff and (daisy-wheel) nroff accents |
|
103 |
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' |
|
104 |
.ds 8 \h'\*(#H'\(*b\h'-\*(#H' |
|
105 |
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] |
|
106 |
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' |
|
107 |
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' |
|
108 |
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] |
|
109 |
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] |
|
110 |
.ds ae a\h'-(\w'a'u*4/10)'e |
|
111 |
.ds Ae A\h'-(\w'A'u*4/10)'E |
|
112 |
. \" corrections for vroff |
|
113 |
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' |
|
114 |
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' |
|
115 |
. \" for low resolution devices (crt and lpr) |
|
116 |
.if \n(.H>23 .if \n(.V>19 \ |
|
117 |
\{\ |
|
118 |
. ds : e |
|
119 |
. ds 8 ss |
|
120 |
. ds o a |
|
121 |
. ds d- d\h'-1'\(ga |
|
122 |
. ds D- D\h'-1'\(hy |
|
123 |
. ds th \o'bp' |
|
124 |
. ds Th \o'LP' |
|
125 |
. ds ae ae |
|
126 |
. ds Ae AE |
|
127 |
.\} |
|
128 |
.rm #[ #] #H #V #F C |
|
129 |
.\" ======================================================================== |
|
130 |
.\" |
|
131 |
.IX Title "DBIx::Custom 3" |
|
132 |
.TH DBIx::Custom 3 "2011-08-06" "perl v5.8.8" "User Contributed Perl Documentation" |
|
133 |
.SH "NAME" |
|
134 |
DBIx::Custom \- Execute insert, update, delete, and select statement easily |
|
135 |
.SH "SYNOPSYS" |
|
136 |
.IX Header "SYNOPSYS" |
|
137 |
.Vb 1 |
|
138 |
\& use DBIx::Custom; |
|
139 |
.Ve |
|
140 |
.PP |
|
141 |
.Vb 7 |
|
142 |
\& # Connect |
|
143 |
\& my $dbi = DBIx::Custom->connect( |
|
144 |
\& dsn => "dbi:mysql:database=dbname", |
|
145 |
\& user => 'ken', |
|
146 |
\& password => '!LFKD%$&', |
|
147 |
\& dbi_option => {mysql_enable_utf8 => 1} |
|
148 |
\& ); |
|
149 |
.Ve |
|
150 |
.PP |
|
151 |
.Vb 2 |
|
152 |
\& # Insert |
|
153 |
\& $dbi->insert({title => 'Perl', author => 'Ken'}, table => 'book'); |
|
154 |
.Ve |
|
155 |
.PP |
|
156 |
.Vb 3 |
|
157 |
\& # Update |
|
158 |
\& $dbi->update({title => 'Perl', author => 'Ken'}, table => 'book', |
|
159 |
\& where => {id => 5}); |
|
160 |
.Ve |
|
161 |
.PP |
|
162 |
.Vb 2 |
|
163 |
\& # Delete |
|
164 |
\& $dbi->delete(table => 'book', where => {author => 'Ken'}); |
|
165 |
.Ve |
|
166 |
.PP |
|
167 |
.Vb 3 |
|
168 |
\& # Select |
|
169 |
\& my $result = $dbi->select(table => 'book', |
|
170 |
\& column => ['title', 'author'], where => {author => 'Ken'}); |
|
171 |
.Ve |
|
172 |
.PP |
|
173 |
.Vb 11 |
|
174 |
\& # Select, more complex |
|
175 |
\& my $result = $dbi->select( |
|
176 |
\& table => 'book', |
|
177 |
\& column => [ |
|
178 |
\& {book => [qw/title author/]}, |
|
179 |
\& {company => ['name']} |
|
180 |
\& ], |
|
181 |
\& where => {'book.author' => 'Ken'}, |
|
182 |
\& join => ['left outer join company on book.company_id = company.id'], |
|
183 |
\& append => 'order by id limit 5' |
|
184 |
\& ); |
|
185 |
.Ve |
|
186 |
.PP |
|
187 |
.Vb 2 |
|
188 |
\& # Fetch |
|
189 |
\& while (my $row = $result->fetch) { |
|
190 |
.Ve |
|
191 |
.PP |
|
192 |
.Vb 1 |
|
193 |
\& } |
|
194 |
.Ve |
|
195 |
.PP |
|
196 |
.Vb 2 |
|
197 |
\& # Fetch as hash |
|
198 |
\& while (my $row = $result->fetch_hash) { |
|
199 |
.Ve |
|
200 |
.PP |
|
201 |
.Vb 1 |
|
202 |
\& } |
|
203 |
.Ve |
|
204 |
.PP |
|
205 |
.Vb 5 |
|
206 |
\& # Execute SQL with parameter. |
|
207 |
\& $dbi->execute( |
|
208 |
\& "select id from book where author = :author and title like :title", |
|
209 |
\& {author => 'ken', title => '%Perl%'} |
|
210 |
\& ); |
|
211 |
.Ve |
|
212 |
.SH "DESCRIPTIONS" |
|
213 |
.IX Header "DESCRIPTIONS" |
|
214 |
DBIx::Custom is \s-1DBI\s0 wrapper module to execute \s-1SQL\s0 easily. |
|
215 |
This module have the following features. |
|
216 |
.IP "\(bu" 4 |
|
217 |
Execute \f(CW\*(C`insert\*(C'\fR, \f(CW\*(C`update\*(C'\fR, \f(CW\*(C`delete\*(C'\fR, or \f(CW\*(C`select\*(C'\fR statement easily |
|
218 |
.IP "\(bu" 4 |
|
219 |
Create \f(CW\*(C`where\*(C'\fR clause flexibly |
|
220 |
.IP "\(bu" 4 |
|
221 |
Named place holder support |
|
222 |
.IP "\(bu" 4 |
|
223 |
Model support |
|
224 |
.IP "\(bu" 4 |
|
225 |
Connection manager support |
|
226 |
.IP "\(bu" 4 |
|
227 |
Choice your favorite relational database management system, |
|
228 |
\&\f(CW\*(C`MySQL\*(C'\fR, \f(CW\*(C`SQLite\*(C'\fR, \f(CW\*(C`PostgreSQL\*(C'\fR, \f(CW\*(C`Oracle\*(C'\fR, |
|
229 |
\&\f(CW\*(C`Microsoft SQL Server\*(C'\fR, \f(CW\*(C`Microsoft Access\*(C'\fR, \f(CW\*(C`DB2\*(C'\fR or anything, |
|
230 |
.IP "\(bu" 4 |
|
231 |
Filtering by data type or column name(\s-1EXPERIMENTAL\s0) |
|
232 |
.IP "\(bu" 4 |
|
233 |
Create \f(CW\*(C`order by\*(C'\fR clause flexibly(\s-1EXPERIMENTAL\s0) |
|
234 |
.SH "DOCUMENTATIONS" |
|
235 |
.IX Header "DOCUMENTATIONS" |
|
236 |
DBIx::Custom::Guide \- How to use DBIx::Custom |
|
237 |
.PP |
|
238 |
DBIx::Custom Wiki |
|
239 |
\&\- Theare are various examples. |
|
240 |
.PP |
|
241 |
Module documentations \- |
|
242 |
DBIx::Custom::Result, |
|
243 |
DBIx::Custom::Query, |
|
244 |
DBIx::Custom::Where, |
|
245 |
DBIx::Custom::Model, |
|
246 |
DBIx::Custom::Order |
|
247 |
.SH "ATTRIBUTES" |
|
248 |
.IX Header "ATTRIBUTES" |
|
249 |
.ie n .Sh """connector""" |
|
250 |
.el .Sh "\f(CWconnector\fP" |
|
251 |
.IX Subsection "connector" |
|
252 |
.Vb 2 |
|
253 |
\& my $connector = $dbi->connector; |
|
254 |
\& $dbi = $dbi->connector($connector); |
|
255 |
.Ve |
|
256 |
.PP |
|
257 |
Connection manager object. if \f(CW\*(C`connector\*(C'\fR is set, you can get \f(CW\*(C`dbh\*(C'\fR |
|
258 |
through connection manager. Conection manager object must have \f(CW\*(C`dbh\*(C'\fR mehtod. |
|
259 |
.PP |
|
260 |
This is DBIx::Connector example. Please pass |
|
261 |
\&\f(CW\*(C`default_dbi_option\*(C'\fR to DBIx::Connector \f(CW\*(C`new\*(C'\fR method. |
|
262 |
.PP |
|
263 |
.Vb 6 |
|
264 |
\& my $connector = DBIx::Connector->new( |
|
265 |
\& "dbi:mysql:database=$DATABASE", |
|
266 |
\& $USER, |
|
267 |
\& $PASSWORD, |
|
268 |
\& DBIx::Custom->new->default_dbi_option |
|
269 |
\& ); |
|
270 |
.Ve |
|
271 |
.PP |
|
272 |
.Vb 1 |
|
273 |
\& my $dbi = DBIx::Custom->connect(connector => $connector); |
|
274 |
.Ve |
|
275 |
.ie n .Sh """dsn""" |
|
276 |
.el .Sh "\f(CWdsn\fP" |
|
277 |
.IX Subsection "dsn" |
|
278 |
.Vb 2 |
|
279 |
\& my $dsn = $dbi->dsn; |
|
280 |
\& $dbi = $dbi->dsn("DBI:mysql:database=dbname"); |
|
281 |
.Ve |
|
282 |
.PP |
|
283 |
Data source name, used when \f(CW\*(C`connect\*(C'\fR method is executed. |
|
284 |
.ie n .Sh """dbi_option""" |
|
285 |
.el .Sh "\f(CWdbi_option\fP" |
|
286 |
.IX Subsection "dbi_option" |
|
287 |
.Vb 2 |
|
288 |
\& my $dbi_option = $dbi->dbi_option; |
|
289 |
\& $dbi = $dbi->dbi_option($dbi_option); |
|
290 |
.Ve |
|
291 |
.PP |
|
292 |
\&\s-1DBI\s0 option, used when \f(CW\*(C`connect\*(C'\fR method is executed. |
|
293 |
Each value in option override the value of \f(CW\*(C`default_dbi_option\*(C'\fR. |
|
294 |
.ie n .Sh """default_dbi_option""" |
|
295 |
.el .Sh "\f(CWdefault_dbi_option\fP" |
|
296 |
.IX Subsection "default_dbi_option" |
|
297 |
.Vb 2 |
|
298 |
\& my $default_dbi_option = $dbi->default_dbi_option; |
|
299 |
\& $dbi = $dbi->default_dbi_option($default_dbi_option); |
|
300 |
.Ve |
|
301 |
.PP |
|
302 |
\&\s-1DBI\s0 default option, used when \f(CW\*(C`connect\*(C'\fR method is executed, |
|
303 |
default to the following values. |
|
304 |
.PP |
|
305 |
.Vb 5 |
|
306 |
\& { |
|
307 |
\& RaiseError => 1, |
|
308 |
\& PrintError => 0, |
|
309 |
\& AutoCommit => 1, |
|
310 |
\& } |
|
311 |
.Ve |
|
312 |
.ie n .Sh """filters""" |
|
313 |
.el .Sh "\f(CWfilters\fP" |
|
314 |
.IX Subsection "filters" |
|
315 |
.Vb 2 |
|
316 |
\& my $filters = $dbi->filters; |
|
317 |
\& $dbi = $dbi->filters(\e%filters); |
|
318 |
.Ve |
|
319 |
.PP |
|
320 |
Filters, registered by \f(CW\*(C`register_filter\*(C'\fR method. |
|
321 |
.ie n .Sh """last_sql""" |
|
322 |
.el .Sh "\f(CWlast_sql\fP" |
|
323 |
.IX Subsection "last_sql" |
|
324 |
.Vb 2 |
|
325 |
\& my $last_sql = $dbi->last_sql; |
|
326 |
\& $dbi = $dbi->last_sql($last_sql); |
|
327 |
.Ve |
|
328 |
.PP |
|
329 |
Get last successed \s-1SQL\s0 executed by \f(CW\*(C`execute\*(C'\fR method. |
|
330 |
.ie n .Sh """models""" |
|
331 |
.el .Sh "\f(CWmodels\fP" |
|
332 |
.IX Subsection "models" |
|
333 |
.Vb 2 |
|
334 |
\& my $models = $dbi->models; |
|
335 |
\& $dbi = $dbi->models(\e%models); |
|
336 |
.Ve |
|
337 |
.PP |
|
338 |
Models, included by \f(CW\*(C`include_model\*(C'\fR method. |
|
339 |
.ie n .Sh """password""" |
|
340 |
.el .Sh "\f(CWpassword\fP" |
|
341 |
.IX Subsection "password" |
|
342 |
.Vb 2 |
|
343 |
\& my $password = $dbi->password; |
|
344 |
\& $dbi = $dbi->password('lkj&le`@s'); |
|
345 |
.Ve |
|
346 |
.PP |
|
347 |
Password, used when \f(CW\*(C`connect\*(C'\fR method is executed. |
|
348 |
.ie n .Sh """query_builder""" |
|
349 |
.el .Sh "\f(CWquery_builder\fP" |
|
350 |
.IX Subsection "query_builder" |
|
351 |
.Vb 2 |
|
352 |
\& my $sql_class = $dbi->query_builder; |
|
353 |
\& $dbi = $dbi->query_builder(DBIx::Custom::QueryBuilder->new); |
|
354 |
.Ve |
|
355 |
.PP |
|
356 |
Query builder, default to DBIx::Custom::QueryBuilder object. |
|
357 |
.ie n .Sh """quote""" |
|
358 |
.el .Sh "\f(CWquote\fP" |
|
359 |
.IX Subsection "quote" |
|
360 |
.Vb 2 |
|
361 |
\& my quote = $dbi->quote; |
|
362 |
\& $dbi = $dbi->quote('"'); |
|
363 |
.Ve |
|
364 |
.PP |
|
365 |
Reserved word quote. |
|
366 |
Default to double quote '"' except for mysql. |
|
367 |
In mysql, default to back quote '`' |
|
368 |
.PP |
|
369 |
You can set quote pair. |
|
370 |
.PP |
|
371 |
.Vb 1 |
|
372 |
\& $dbi->quote('[]'); |
|
373 |
.Ve |
|
374 |
.ie n .Sh """result_class""" |
|
375 |
.el .Sh "\f(CWresult_class\fP" |
|
376 |
.IX Subsection "result_class" |
|
377 |
.Vb 2 |
|
378 |
\& my $result_class = $dbi->result_class; |
|
379 |
\& $dbi = $dbi->result_class('DBIx::Custom::Result'); |
|
380 |
.Ve |
|
381 |
.PP |
|
382 |
Result class, default to DBIx::Custom::Result. |
|
383 |
.ie n .Sh """safety_character""" |
|
384 |
.el .Sh "\f(CWsafety_character\fP" |
|
385 |
.IX Subsection "safety_character" |
|
386 |
.Vb 2 |
|
387 |
\& my $safety_character = $self->safety_character; |
|
388 |
\& $dbi = $self->safety_character($character); |
|
389 |
.Ve |
|
390 |
.PP |
|
391 |
Regex of safety character for table and column name, default to '\ew'. |
|
392 |
Note that you don't have to specify like '[\ew]'. |
|
393 |
.ie n .Sh """tag_parse""" |
|
394 |
.el .Sh "\f(CWtag_parse\fP" |
|
395 |
.IX Subsection "tag_parse" |
|
396 |
.Vb 2 |
|
397 |
\& my $tag_parse = $dbi->tag_parse(0); |
|
398 |
\& $dbi = $dbi->tag_parse; |
|
399 |
.Ve |
|
400 |
.PP |
|
401 |
Enable \s-1DEPRECATED\s0 tag parsing functionality, default to 1. |
|
402 |
If you want to disable tag parsing functionality, set to 0. |
|
403 |
.ie n .Sh """user""" |
|
404 |
.el .Sh "\f(CWuser\fP" |
|
405 |
.IX Subsection "user" |
|
406 |
.Vb 2 |
|
407 |
\& my $user = $dbi->user; |
|
408 |
\& $dbi = $dbi->user('Ken'); |
|
409 |
.Ve |
|
410 |
.PP |
|
411 |
User name, used when \f(CW\*(C`connect\*(C'\fR method is executed. |
|
412 |
.SH "METHODS" |
|
413 |
.IX Header "METHODS" |
|
414 |
DBIx::Custom inherits all methods from Object::Simple |
|
415 |
and use all methods of \s-1DBI\s0 |
|
416 |
and implements the following new ones. |
|
417 |
.ie n .Sh """available_data_type"" \s-1EXPERIMENTAL\s0" |
|
418 |
.el .Sh "\f(CWavailable_data_type\fP \s-1EXPERIMENTAL\s0" |
|
419 |
.IX Subsection "available_data_type EXPERIMENTAL" |
|
420 |
.Vb 1 |
|
421 |
\& print $dbi->available_data_type; |
|
422 |
.Ve |
|
423 |
.PP |
|
424 |
Get available data types. You can use these data types |
|
425 |
in \f(CW\*(C`type rule\*(C'\fR's \f(CW\*(C`from1\*(C'\fR and \f(CW\*(C`from2\*(C'\fR section. |
|
426 |
.ie n .Sh """available_type_name"" \s-1EXPERIMENTAL\s0" |
|
427 |
.el .Sh "\f(CWavailable_type_name\fP \s-1EXPERIMENTAL\s0" |
|
428 |
.IX Subsection "available_type_name EXPERIMENTAL" |
|
429 |
.Vb 1 |
|
430 |
\& print $dbi->available_type_name; |
|
431 |
.Ve |
|
432 |
.PP |
|
433 |
Get available type names. You can use these type names in |
|
434 |
\&\f(CW\*(C`type_rule\*(C'\fR's \f(CW\*(C`into1\*(C'\fR and \f(CW\*(C`into2\*(C'\fR section. |
|
435 |
.ie n .Sh """assign_param"" \s-1EXPERIMENTAL\s0" |
|
436 |
.el .Sh "\f(CWassign_param\fP \s-1EXPERIMENTAL\s0" |
|
437 |
.IX Subsection "assign_param EXPERIMENTAL" |
|
438 |
.Vb 1 |
|
439 |
\& my $assign_param = $dbi->assign_param({title => 'a', age => 2}); |
|
440 |
.Ve |
|
441 |
.PP |
|
442 |
Create assign parameter. |
|
443 |
.PP |
|
444 |
.Vb 1 |
|
445 |
\& title = :title, author = :author |
|
446 |
.Ve |
|
447 |
.PP |
|
448 |
This is equal to \f(CW\*(C`update_param\*(C'\fR exept that set is not added. |
|
449 |
.ie n .Sh """column""" |
|
450 |
.el .Sh "\f(CWcolumn\fP" |
|
451 |
.IX Subsection "column" |
|
452 |
.Vb 1 |
|
453 |
\& my $column = $dbi->column(book => ['author', 'title']); |
|
454 |
.Ve |
|
455 |
.PP |
|
456 |
Create column clause. The follwoing column clause is created. |
|
457 |
.PP |
|
458 |
.Vb 2 |
|
459 |
\& book.author as "book.author", |
|
460 |
\& book.title as "book.title" |
|
461 |
.Ve |
|
462 |
.PP |
|
463 |
You can change separator by \f(CW\*(C`separator\*(C'\fR method. |
|
464 |
.PP |
|
465 |
.Vb 2 |
|
466 |
\& # Separator is double underbar |
|
467 |
\& $dbi->separator('__'); |
|
468 |
.Ve |
|
469 |
.PP |
|
470 |
.Vb 2 |
|
471 |
\& book.author as "book__author", |
|
472 |
\& book.title as "book__title" |
|
473 |
.Ve |
|
474 |
.PP |
|
475 |
.Vb 2 |
|
476 |
\& # Separator is hyphen |
|
477 |
\& $dbi->separator('-'); |
|
478 |
.Ve |
|
479 |
.PP |
|
480 |
.Vb 2 |
|
481 |
\& book.author as "book-author", |
|
482 |
\& book.title as "book-title" |
|
483 |
.Ve |
|
484 |
.ie n .Sh """connect""" |
|
485 |
.el .Sh "\f(CWconnect\fP" |
|
486 |
.IX Subsection "connect" |
|
487 |
.Vb 6 |
|
488 |
\& my $dbi = DBIx::Custom->connect( |
|
489 |
\& dsn => "dbi:mysql:database=dbname", |
|
490 |
\& user => 'ken', |
|
491 |
\& password => '!LFKD%$&', |
|
492 |
\& dbi_option => {mysql_enable_utf8 => 1} |
|
493 |
\& ); |
|
494 |
.Ve |
|
495 |
.PP |
|
496 |
Connect to the database and create a new DBIx::Custom object. |
|
497 |
.PP |
|
498 |
DBIx::Custom is a wrapper of \s-1DBI\s0. |
|
499 |
\&\f(CW\*(C`AutoCommit\*(C'\fR and \f(CW\*(C`RaiseError\*(C'\fR options are true, |
|
500 |
and \f(CW\*(C`PrintError\*(C'\fR option is false by default. |
|
501 |
.Sh "create_model" |
|
502 |
.IX Subsection "create_model" |
|
503 |
.Vb 7 |
|
504 |
\& my $model = $dbi->create_model( |
|
505 |
\& table => 'book', |
|
506 |
\& primary_key => 'id', |
|
507 |
\& join => [ |
|
508 |
\& 'inner join company on book.comparny_id = company.id' |
|
509 |
\& ], |
|
510 |
\& ); |
|
511 |
.Ve |
|
512 |
.PP |
|
513 |
Create DBIx::Custom::Model object and initialize model. |
|
514 |
the module is also used from \f(CW\*(C`model\*(C'\fR method. |
|
515 |
.PP |
|
516 |
.Vb 1 |
|
517 |
\& $dbi->model('book')->select(...); |
|
518 |
.Ve |
|
519 |
.ie n .Sh """dbh""" |
|
520 |
.el .Sh "\f(CWdbh\fP" |
|
521 |
.IX Subsection "dbh" |
|
522 |
.Vb 1 |
|
523 |
\& my $dbh = $dbi->dbh; |
|
524 |
.Ve |
|
525 |
.PP |
|
526 |
Get \s-1DBI\s0 database handle. if \f(CW\*(C`connector\*(C'\fR is set, you can get |
|
527 |
database handle through \f(CW\*(C`connector\*(C'\fR object. |
|
528 |
.ie n .Sh """each_column""" |
|
529 |
.el .Sh "\f(CWeach_column\fP" |
|
530 |
.IX Subsection "each_column" |
|
531 |
.Vb 3 |
|
532 |
\& $dbi->each_column( |
|
533 |
\& sub { |
|
534 |
\& my ($dbi, $table, $column, $column_info) = @_; |
|
535 |
.Ve |
|
536 |
.PP |
|
537 |
.Vb 1 |
|
538 |
\& my $type = $column_info->{TYPE_NAME}; |
|
539 |
.Ve |
|
540 |
.PP |
|
541 |
.Vb 5 |
|
542 |
\& if ($type eq 'DATE') { |
|
543 |
\& # ... |
|
544 |
\& } |
|
545 |
\& } |
|
546 |
\& ); |
|
547 |
.Ve |
|
548 |
.PP |
|
549 |
Iterate all column informations of all table from database. |
|
550 |
Argument is callback when one column is found. |
|
551 |
Callback receive four arguments, dbi object, table name, |
|
552 |
column name and column information. |
|
553 |
.ie n .Sh """each_table""" |
|
554 |
.el .Sh "\f(CWeach_table\fP" |
|
555 |
.IX Subsection "each_table" |
|
556 |
.Vb 3 |
|
557 |
\& $dbi->each_table( |
|
558 |
\& sub { |
|
559 |
\& my ($dbi, $table, $table_info) = @_; |
|
560 |
.Ve |
|
561 |
.PP |
|
562 |
.Vb 3 |
|
563 |
\& my $table_name = $table_info->{TABLE_NAME}; |
|
564 |
\& } |
|
565 |
\& ); |
|
566 |
.Ve |
|
567 |
.PP |
|
568 |
Iterate all table informationsfrom database. |
|
569 |
Argument is callback when one table is found. |
|
570 |
Callback receive three arguments, dbi object, table name, |
|
571 |
table information. |
|
572 |
.ie n .Sh """execute""" |
|
573 |
.el .Sh "\f(CWexecute\fP" |
|
574 |
.IX Subsection "execute" |
|
575 |
.Vb 4 |
|
576 |
\& my $result = $dbi->execute( |
|
577 |
\& "select * from book where title = :title and author like :author", |
|
578 |
\& {title => 'Perl', author => '%Ken%'} |
|
579 |
\& ); |
|
580 |
.Ve |
|
581 |
.PP |
|
582 |
.Vb 4 |
|
583 |
\& my $result = $dbi->execute( |
|
584 |
\& "select * from book where title = :book.title and author like :book.author", |
|
585 |
\& {'book.title' => 'Perl', 'book.author' => '%Ken%'} |
|
586 |
\& ); |
|
587 |
.Ve |
|
588 |
.PP |
|
589 |
Execute \s-1SQL\s0. \s-1SQL\s0 can contain column parameter such as :author and :title. |
|
590 |
You can append table name to column name such as :book.title and :book.author. |
|
591 |
Second argunet is data, embedded into column parameter. |
|
592 |
Return value is DBIx::Custom::Result object when select statement is executed, |
|
593 |
or the count of affected rows when insert, update, delete statement is executed. |
|
594 |
.PP |
|
595 |
Named placeholder such as \f(CW\*(C`:title\*(C'\fR is replaced by placeholder \f(CW\*(C`?\*(C'\fR. |
|
596 |
.PP |
|
597 |
.Vb 2 |
|
598 |
\& # Original |
|
599 |
\& select * from book where title = :title and author like :author |
|
600 |
.Ve |
|
601 |
.PP |
|
602 |
.Vb 2 |
|
603 |
\& # Replaced |
|
604 |
\& select * from where title = ? and author like ?; |
|
605 |
.Ve |
|
606 |
.PP |
|
607 |
You can specify operator with named placeholder |
|
608 |
by \f(CW\*(C`name{operator}\*(C'\fR syntax. |
|
609 |
.PP |
|
610 |
.Vb 2 |
|
611 |
\& # Original |
|
612 |
\& select * from book where :title{=} and :author{like} |
|
613 |
.Ve |
|
614 |
.PP |
|
615 |
.Vb 2 |
|
616 |
\& # Replaced |
|
617 |
\& select * from where title = ? and author like ?; |
|
618 |
.Ve |
|
619 |
.PP |
|
620 |
Note that colons in time format such as 12:13:15 is exeption, |
|
621 |
it is not parsed as named placeholder. |
|
622 |
If you want to use colon generally, you must escape it by \f(CW\*(C`\e\e\*(C'\fR |
|
623 |
.PP |
|
624 |
.Vb 1 |
|
625 |
\& select * from where title = "aa\e\e:bb"; |
|
626 |
.Ve |
|
627 |
.PP |
|
628 |
The following opitons are available. |
|
629 |
.ie n .IP """filter""" 4 |
|
630 |
.el .IP "\f(CWfilter\fR" 4 |
|
631 |
.IX Item "filter" |
|
632 |
.Vb 4 |
|
633 |
\& filter => { |
|
634 |
\& title => sub { uc $_[0] } |
|
635 |
\& author => sub { uc $_[0] } |
|
636 |
\& } |
|
637 |
.Ve |
|
638 |
.Sp |
|
639 |
.Vb 5 |
|
640 |
\& # Filter name |
|
641 |
\& filter => { |
|
642 |
\& title => 'upper_case', |
|
643 |
\& author => 'upper_case' |
|
644 |
\& } |
|
645 |
.Ve |
|
646 |
.Sp |
|
647 |
.Vb 4 |
|
648 |
\& # At once |
|
649 |
\& filter => [ |
|
650 |
\& [qw/title author/] => sub { uc $_[0] } |
|
651 |
\& ] |
|
652 |
.Ve |
|
653 |
.Sp |
|
654 |
Filter. You can set subroutine or filter name |
|
655 |
registered by by \f(CW\*(C`register_filter\*(C'\fR. |
|
656 |
This filter is executed before data is saved into database. |
|
657 |
and before type rule filter is executed. |
|
658 |
.ie n .IP """query""" 4 |
|
659 |
.el .IP "\f(CWquery\fR" 4 |
|
660 |
.IX Item "query" |
|
661 |
.Vb 1 |
|
662 |
\& query => 1 |
|
663 |
.Ve |
|
664 |
.Sp |
|
665 |
\&\f(CW\*(C`execute\*(C'\fR method return DBIx::Custom::Query object, not executing \s-1SQL\s0. |
|
666 |
You can check \s-1SQL\s0 or get statment handle. |
|
667 |
.Sp |
|
668 |
.Vb 3 |
|
669 |
\& my $sql = $query->sql; |
|
670 |
\& my $sth = $query->sth; |
|
671 |
\& my $columns = $query->columns; |
|
672 |
.Ve |
|
673 |
.Sp |
|
674 |
If you want to execute \s-1SQL\s0 fast, you can do the following way. |
|
675 |
.Sp |
|
676 |
.Vb 5 |
|
677 |
\& my $query; |
|
678 |
\& foreach my $row (@$rows) { |
|
679 |
\& $query ||= $dbi->insert($row, table => 'table1', query => 1); |
|
680 |
\& $dbi->execute($query, $row, filter => {ab => sub { $_[0] * 2 }}); |
|
681 |
\& } |
|
682 |
.Ve |
|
683 |
.Sp |
|
684 |
Statement handle is reused and \s-1SQL\s0 parsing is finished, |
|
685 |
so you can get more performance than normal way. |
|
686 |
.Sp |
|
687 |
If you want to execute \s-1SQL\s0 as possible as fast and don't need filtering. |
|
688 |
You can do the following way. |
|
689 |
.Sp |
|
690 |
.Vb 7 |
|
691 |
\& my $query; |
|
692 |
\& my $sth; |
|
693 |
\& foreach my $row (@$rows) { |
|
694 |
\& $query ||= $dbi->insert($row, table => 'book', query => 1); |
|
695 |
\& $sth ||= $query->sth; |
|
696 |
\& $sth->execute(map { $row->{$_} } sort keys %$row); |
|
697 |
\& } |
|
698 |
.Ve |
|
699 |
.Sp |
|
700 |
Note that \f(CW$row\fR must be simple hash reference, such as |
|
701 |
{title => 'Perl', author => 'Ken'}. |
|
702 |
and don't forget to sort \f(CW$row\fR values by \f(CW$row\fR key asc order. |
|
703 |
.ie n .IP """table""" 4 |
|
704 |
.el .IP "\f(CWtable\fR" 4 |
|
705 |
.IX Item "table" |
|
706 |
.Vb 1 |
|
707 |
\& table => 'author' |
|
708 |
.Ve |
|
709 |
.Sp |
|
710 |
If you want to omit table name in column name |
|
711 |
and enable \f(CW\*(C`into1\*(C'\fR and \f(CW\*(C`into2\*(C'\fR type filter, |
|
712 |
You must set \f(CW\*(C`table\*(C'\fR option. |
|
713 |
.Sp |
|
714 |
.Vb 2 |
|
715 |
\& $dbi->execute("select * from book where title = :title and author = :author", |
|
716 |
\& {title => 'Perl', author => 'Ken', table => 'book'); |
|
717 |
.Ve |
|
718 |
.Sp |
|
719 |
.Vb 4 |
|
720 |
\& # Same |
|
721 |
\& $dbi->execute( |
|
722 |
\& "select * from book where title = :book.title and author = :book.author", |
|
723 |
\& {title => 'Perl', author => 'Ken'); |
|
724 |
.Ve |
|
725 |
.ie n .IP """bind_type""" 4 |
|
726 |
.el .IP "\f(CWbind_type\fR" 4 |
|
727 |
.IX Item "bind_type" |
|
728 |
Specify database bind data type. |
|
729 |
.Sp |
|
730 |
.Vb 2 |
|
731 |
\& bind_type => [image => DBI::SQL_BLOB] |
|
732 |
\& bind_type => [[qw/image audio/] => DBI::SQL_BLOB] |
|
733 |
.Ve |
|
734 |
.Sp |
|
735 |
This is used to bind parameter by \f(CW\*(C`bind_param\*(C'\fR of statment handle. |
|
736 |
.Sp |
|
737 |
.Vb 1 |
|
738 |
\& $sth->bind_param($pos, $value, DBI::SQL_BLOB); |
|
739 |
.Ve |
|
740 |
.ie n .IP """table_alias"" \s-1EXPERIMENTAL\s0" 4 |
|
741 |
.el .IP "\f(CWtable_alias\fR \s-1EXPERIMENTAL\s0" 4 |
|
742 |
.IX Item "table_alias EXPERIMENTAL" |
|
743 |
.Vb 1 |
|
744 |
\& table_alias => {user => 'hiker'} |
|
745 |
.Ve |
|
746 |
.Sp |
|
747 |
Table alias. Key is real table name, value is alias table name. |
|
748 |
If you set \f(CW\*(C`table_alias\*(C'\fR, you can enable \f(CW\*(C`into1\*(C'\fR and \f(CW\*(C`into2\*(C'\fR type rule |
|
749 |
on alias table name. |
|
750 |
.ie n .IP """type_rule_off"" \s-1EXPERIMENTAL\s0" 4 |
|
751 |
.el .IP "\f(CWtype_rule_off\fR \s-1EXPERIMENTAL\s0" 4 |
|
752 |
.IX Item "type_rule_off EXPERIMENTAL" |
|
753 |
.Vb 1 |
|
754 |
\& type_rule_off => 1 |
|
755 |
.Ve |
|
756 |
.Sp |
|
757 |
Turn \f(CW\*(C`into1\*(C'\fR and \f(CW\*(C`into2\*(C'\fR type rule off. |
|
758 |
.ie n .IP """type_rule1_off"" \s-1EXPERIMENTAL\s0" 4 |
|
759 |
.el .IP "\f(CWtype_rule1_off\fR \s-1EXPERIMENTAL\s0" 4 |
|
760 |
.IX Item "type_rule1_off EXPERIMENTAL" |
|
761 |
.Vb 1 |
|
762 |
\& type_rule1_off => 1 |
|
763 |
.Ve |
|
764 |
.Sp |
|
765 |
Turn \f(CW\*(C`into1\*(C'\fR type rule off. |
|
766 |
.ie n .IP """type_rule2_off"" \s-1EXPERIMENTAL\s0" 4 |
|
767 |
.el .IP "\f(CWtype_rule2_off\fR \s-1EXPERIMENTAL\s0" 4 |
|
768 |
.IX Item "type_rule2_off EXPERIMENTAL" |
|
769 |
.Vb 1 |
|
770 |
\& type_rule2_off => 1 |
|
771 |
.Ve |
|
772 |
.Sp |
|
773 |
Turn \f(CW\*(C`into2\*(C'\fR type rule off. |
|
774 |
.ie n .Sh """delete""" |
|
775 |
.el .Sh "\f(CWdelete\fP" |
|
776 |
.IX Subsection "delete" |
|
777 |
.Vb 1 |
|
778 |
\& $dbi->delete(table => 'book', where => {title => 'Perl'}); |
|
779 |
.Ve |
|
780 |
.PP |
|
781 |
Execute delete statement. |
|
782 |
.PP |
|
783 |
The following opitons are available. |
|
784 |
.ie n .IP """append""" 4 |
|
785 |
.el .IP "\f(CWappend\fR" 4 |
|
786 |
.IX Item "append" |
|
787 |
Same as \f(CW\*(C`select\*(C'\fR method's \f(CW\*(C`append\*(C'\fR option. |
|
788 |
.ie n .IP """filter""" 4 |
|
789 |
.el .IP "\f(CWfilter\fR" 4 |
|
790 |
.IX Item "filter" |
|
791 |
Same as \f(CW\*(C`execute\*(C'\fR method's \f(CW\*(C`filter\*(C'\fR option. |
|
792 |
.ie n .IP """id""" 4 |
|
793 |
.el .IP "\f(CWid\fR" 4 |
|
794 |
.IX Item "id" |
|
795 |
.Vb 2 |
|
796 |
\& id => 4 |
|
797 |
\& id => [4, 5] |
|
798 |
.Ve |
|
799 |
.Sp |
|
800 |
\&\s-1ID\s0 corresponding to \f(CW\*(C`primary_key\*(C'\fR. |
|
801 |
You can delete rows by \f(CW\*(C`id\*(C'\fR and \f(CW\*(C`primary_key\*(C'\fR. |
|
802 |
.Sp |
|
803 |
.Vb 5 |
|
804 |
\& $dbi->delete( |
|
805 |
\& parimary_key => ['id1', 'id2'], |
|
806 |
\& id => [4, 5], |
|
807 |
\& table => 'book', |
|
808 |
\& ); |
|
809 |
.Ve |
|
810 |
.Sp |
|
811 |
The above is same as the followin one. |
|
812 |
.Sp |
|
813 |
.Vb 1 |
|
814 |
\& $dbi->delete(where => {id1 => 4, id2 => 5}, table => 'book'); |
|
815 |
.Ve |
|
816 |
.ie n .IP """prefix""" 4 |
|
817 |
.el .IP "\f(CWprefix\fR" 4 |
|
818 |
.IX Item "prefix" |
|
819 |
.Vb 1 |
|
820 |
\& prefix => 'some' |
|
821 |
.Ve |
|
822 |
.Sp |
|
823 |
prefix before table name section. |
|
824 |
.Sp |
|
825 |
.Vb 1 |
|
826 |
\& delete some from book |
|
827 |
.Ve |
|
828 |
.ie n .IP """query""" 4 |
|
829 |
.el .IP "\f(CWquery\fR" 4 |
|
830 |
.IX Item "query" |
|
831 |
Same as \f(CW\*(C`execute\*(C'\fR method's \f(CW\*(C`query\*(C'\fR option. |
|
832 |
.ie n .IP """table""" 4 |
|
833 |
.el .IP "\f(CWtable\fR" 4 |
|
834 |
.IX Item "table" |
|
835 |
.Vb 1 |
|
836 |
\& table => 'book' |
|
837 |
.Ve |
|
838 |
.Sp |
|
839 |
Table name. |
|
840 |
.ie n .IP """where""" 4 |
|
841 |
.el .IP "\f(CWwhere\fR" 4 |
|
842 |
.IX Item "where" |
|
843 |
Same as \f(CW\*(C`select\*(C'\fR method's \f(CW\*(C`where\*(C'\fR option. |
|
844 |
.ie n .IP """primary_key""" 4 |
|
845 |
.el .IP "\f(CWprimary_key\fR" 4 |
|
846 |
.IX Item "primary_key" |
|
847 |
See \f(CW\*(C`id\*(C'\fR option. |
|
848 |
.ie n .IP """bind_type""" 4 |
|
849 |
.el .IP "\f(CWbind_type\fR" 4 |
|
850 |
.IX Item "bind_type" |
|
851 |
Same as \f(CW\*(C`execute\*(C'\fR method's \f(CW\*(C`bind_type\*(C'\fR option. |
|
852 |
.ie n .IP """type_rule_off"" \s-1EXPERIMENTAL\s0" 4 |
|
853 |
.el .IP "\f(CWtype_rule_off\fR \s-1EXPERIMENTAL\s0" 4 |
|
854 |
.IX Item "type_rule_off EXPERIMENTAL" |
|
855 |
Same as \f(CW\*(C`execute\*(C'\fR method's \f(CW\*(C`type_rule_off\*(C'\fR option. |
|
856 |
.ie n .IP """type_rule1_off"" \s-1EXPERIMENTAL\s0" 4 |
|
857 |
.el .IP "\f(CWtype_rule1_off\fR \s-1EXPERIMENTAL\s0" 4 |
|
858 |
.IX Item "type_rule1_off EXPERIMENTAL" |
|
859 |
.Vb 1 |
|
860 |
\& type_rule1_off => 1 |
|
861 |
.Ve |
|
862 |
.Sp |
|
863 |
Same as \f(CW\*(C`execute\*(C'\fR method's \f(CW\*(C`type_rule1_off\*(C'\fR option. |
|
864 |
.ie n .IP """type_rule2_off"" \s-1EXPERIMENTAL\s0" 4 |
|
865 |
.el .IP "\f(CWtype_rule2_off\fR \s-1EXPERIMENTAL\s0" 4 |
|
866 |
.IX Item "type_rule2_off EXPERIMENTAL" |
|
867 |
.Vb 1 |
|
868 |
\& type_rule2_off => 1 |
|
869 |
.Ve |
|
870 |
.Sp |
|
871 |
Same as \f(CW\*(C`execute\*(C'\fR method's \f(CW\*(C`type_rule2_off\*(C'\fR option. |
|
872 |
.ie n .Sh """delete_all""" |
|
873 |
.el .Sh "\f(CWdelete_all\fP" |
|
874 |
.IX Subsection "delete_all" |
|
875 |
.Vb 1 |
|
876 |
\& $dbi->delete_all(table => $table); |
|
877 |
.Ve |
|
878 |
.PP |
|
879 |
Execute delete statement for all rows. |
|
880 |
Options is same as \f(CW\*(C`delete\*(C'\fR. |
|
881 |
.ie n .Sh """insert""" |
|
882 |
.el .Sh "\f(CWinsert\fP" |
|
883 |
.IX Subsection "insert" |
|
884 |
.Vb 1 |
|
885 |
\& $dbi->insert({title => 'Perl', author => 'Ken'}, table => 'book'); |
|
886 |
.Ve |
|
887 |
.PP |
|
888 |
Execute insert statement. First argument is row data. Return value is |
|
889 |
affected row count. |
|
890 |
.PP |
|
891 |
If you want to set constant value to row data, use scalar reference |
|
892 |
as parameter value. |
|
893 |
.PP |
|
894 |
.Vb 1 |
|
895 |
\& {date => \e"NOW()"} |
|
896 |
.Ve |
|
897 |
.PP |
|
898 |
The following opitons are available. |
|
899 |
.ie n .IP """append""" 4 |
|
900 |
.el .IP "\f(CWappend\fR" 4 |
|
901 |
.IX Item "append" |
|
902 |
Same as \f(CW\*(C`select\*(C'\fR method's \f(CW\*(C`append\*(C'\fR option. |
|
903 |
.ie n .IP """filter""" 4 |
|
904 |
.el .IP "\f(CWfilter\fR" 4 |
|
905 |
.IX Item "filter" |
|
906 |
Same as \f(CW\*(C`execute\*(C'\fR method's \f(CW\*(C`filter\*(C'\fR option. |
|
907 |
.ie n .IP """id""" 4 |
|
908 |
.el .IP "\f(CWid\fR" 4 |
|
909 |
.IX Item "id" |
|
910 |
.Vb 2 |
|
911 |
\& id => 4 |
|
912 |
\& id => [4, 5] |
|
913 |
.Ve |
|
914 |
.Sp |
|
915 |
\&\s-1ID\s0 corresponding to \f(CW\*(C`primary_key\*(C'\fR. |
|
916 |
You can insert a row by \f(CW\*(C`id\*(C'\fR and \f(CW\*(C`primary_key\*(C'\fR. |
|
917 |
.Sp |
|
918 |
.Vb 6 |
|
919 |
\& $dbi->insert( |
|
920 |
\& {title => 'Perl', author => 'Ken'} |
|
921 |
\& parimary_key => ['id1', 'id2'], |
|
922 |
\& id => [4, 5], |
|
923 |
\& table => 'book' |
|
924 |
\& ); |
|
925 |
.Ve |
|
926 |
.Sp |
|
927 |
The above is same as the followin one. |
|
928 |
.Sp |
|
929 |
.Vb 4 |
|
930 |
\& $dbi->insert( |
|
931 |
\& {id1 => 4, id2 => 5, title => 'Perl', author => 'Ken'}, |
|
932 |
\& table => 'book' |
|
933 |
\& ); |
|
934 |
.Ve |
|
935 |
.ie n .IP """prefix""" 4 |
|
936 |
.el .IP "\f(CWprefix\fR" 4 |
|
937 |
.IX Item "prefix" |
|
938 |
.Vb 1 |
|
939 |
\& prefix => 'or replace' |
|
940 |
.Ve |
|
941 |
.Sp |
|
942 |
prefix before table name section |
|
943 |
.Sp |
|
944 |
.Vb 1 |
|
945 |
\& insert or replace into book |
|
946 |
.Ve |
|
947 |
.ie n .IP """primary_key""" 4 |
|
948 |
.el .IP "\f(CWprimary_key\fR" 4 |
|
949 |
.IX Item "primary_key" |
|
950 |
.Vb 2 |
|
951 |
\& primary_key => 'id' |
|
952 |
\& primary_key => ['id1', 'id2'] |
|
953 |
.Ve |
|
954 |
.Sp |
|
955 |
Primary key. This is used by \f(CW\*(C`id\*(C'\fR option. |
|
956 |
.ie n .IP """query""" 4 |
|
957 |
.el .IP "\f(CWquery\fR" 4 |
|
958 |
.IX Item "query" |
|
959 |
Same as \f(CW\*(C`execute\*(C'\fR method's \f(CW\*(C`query\*(C'\fR option. |
|
960 |
.ie n .IP """table""" 4 |
|
961 |
.el .IP "\f(CWtable\fR" 4 |
|
962 |
.IX Item "table" |
|
963 |
.Vb 1 |
|
964 |
\& table => 'book' |
|
965 |
.Ve |
|
966 |
.Sp |
|
967 |
Table name. |
|
968 |
.ie n .IP """bind_type""" 4 |
|
969 |
.el .IP "\f(CWbind_type\fR" 4 |
|
970 |
.IX Item "bind_type" |
|
971 |
Same as \f(CW\*(C`execute\*(C'\fR method's \f(CW\*(C`bind_type\*(C'\fR option. |
|
972 |
.ie n .IP """type_rule_off"" \s-1EXPERIMENTAL\s0" 4 |
|
973 |
.el .IP "\f(CWtype_rule_off\fR \s-1EXPERIMENTAL\s0" 4 |
|
974 |
.IX Item "type_rule_off EXPERIMENTAL" |
|
975 |
Same as \f(CW\*(C`execute\*(C'\fR method's \f(CW\*(C`type_rule_off\*(C'\fR option. |
|
976 |
.ie n .IP """type_rule1_off"" \s-1EXPERIMENTAL\s0" 4 |
|
977 |
.el .IP "\f(CWtype_rule1_off\fR \s-1EXPERIMENTAL\s0" 4 |
|
978 |
.IX Item "type_rule1_off EXPERIMENTAL" |
|
979 |
.Vb 1 |
|
980 |
\& type_rule1_off => 1 |
|
981 |
.Ve |
|
982 |
.Sp |
|
983 |
Same as \f(CW\*(C`execute\*(C'\fR method's \f(CW\*(C`type_rule1_off\*(C'\fR option. |
|
984 |
.ie n .IP """type_rule2_off"" \s-1EXPERIMENTAL\s0" 4 |
|
985 |
.el .IP "\f(CWtype_rule2_off\fR \s-1EXPERIMENTAL\s0" 4 |
|
986 |
.IX Item "type_rule2_off EXPERIMENTAL" |
|
987 |
.Vb 1 |
|
988 |
\& type_rule2_off => 1 |
|
989 |
.Ve |
|
990 |
.Sp |
|
991 |
Same as \f(CW\*(C`execute\*(C'\fR method's \f(CW\*(C`type_rule2_off\*(C'\fR option. |
|
992 |
.ie n .Sh """insert_param""" |
|
993 |
.el .Sh "\f(CWinsert_param\fP" |
|
994 |
.IX Subsection "insert_param" |
|
995 |
.Vb 1 |
|
996 |
\& my $insert_param = $dbi->insert_param({title => 'a', age => 2}); |
|
997 |
.Ve |
|
998 |
.Sp |
|
999 |
.RS 4 |
|
1000 |
Create insert parameters. |
|
1001 |
.Sp |
|
1002 |
.Vb 1 |
|
1003 |
\& (title, author) values (title = :title, age = :age); |
|
1004 |
.Ve |
|
1005 |
.ie n .Sh """include_model""" |
|
1006 |
.el .Sh "\f(CWinclude_model\fP" |
|
1007 |
.IX Subsection "include_model" |
|
1008 |
.Vb 1 |
|
1009 |
\& $dbi->include_model('MyModel'); |
|
1010 |
.Ve |
|
1011 |
.Sp |
|
1012 |
Include models from specified namespace, |
|
1013 |
the following layout is needed to include models. |
|
1014 |
.Sp |
|
1015 |
.Vb 3 |
|
1016 |
\& lib / MyModel.pm |
|
1017 |
\& / MyModel / book.pm |
|
1018 |
\& / company.pm |
|
1019 |
.Ve |
|
1020 |
.Sp |
|
1021 |
Name space module, extending DBIx::Custom::Model. |
|
1022 |
.Sp |
|
1023 |
\&\fBMyModel.pm\fR |
|
1024 |
.Sp |
|
1025 |
.Vb 2 |
|
1026 |
\& package MyModel; |
|
1027 |
\& use DBIx::Custom::Model -base; |
|
1028 |
.Ve |
|
1029 |
.Sp |
|
1030 |
.Vb 1 |
|
1031 |
\& 1; |
|
1032 |
.Ve |
|
1033 |
.Sp |
|
1034 |
Model modules, extending name space module. |
|
1035 |
.Sp |
|
1036 |
\&\fBMyModel/book.pm\fR |
|
1037 |
.Sp |
|
1038 |
.Vb 2 |
|
1039 |
\& package MyModel::book; |
|
1040 |
\& use MyModel -base; |
|
1041 |
.Ve |
|
1042 |
.Sp |
|
1043 |
.Vb 1 |
|
1044 |
\& 1; |
|
1045 |
.Ve |
|
1046 |
.Sp |
|
1047 |
\&\fBMyModel/company.pm\fR |
|
1048 |
.Sp |
|
1049 |
.Vb 2 |
|
1050 |
\& package MyModel::company; |
|
1051 |
\& use MyModel -base; |
|
1052 |
.Ve |
|
1053 |
.Sp |
|
1054 |
.Vb 1 |
|
1055 |
\& 1; |
|
1056 |
.Ve |
|
1057 |
.Sp |
|
1058 |
MyModel::book and MyModel::company is included by \f(CW\*(C`include_model\*(C'\fR. |
|
1059 |
.Sp |
|
1060 |
You can get model object by \f(CW\*(C`model\*(C'\fR. |
|
1061 |
.Sp |
|
1062 |
.Vb 2 |
|
1063 |
\& my $book_model = $dbi->model('book'); |
|
1064 |
\& my $company_model = $dbi->model('company'); |
|
1065 |
.Ve |
|
1066 |
.Sp |
|
1067 |
See DBIx::Custom::Model to know model features. |
|
1068 |
.ie n .Sh """map_param"" \s-1EXPERIMENTAL\s0" |
|
1069 |
.el .Sh "\f(CWmap_param\fP \s-1EXPERIMENTAL\s0" |
|
1070 |
.IX Subsection "map_param EXPERIMENTAL" |
|
1071 |
.Vb 8 |
|
1072 |
\& my $map_param = $dbi->map_param( |
|
1073 |
\& {id => 1, authro => 'Ken', price => 1900}, |
|
1074 |
\& 'id' => 'book.id', |
|
1075 |
\& 'author' => ['book.author' => sub { '%' . $_[0] . '%' }], |
|
1076 |
\& 'price' => [ |
|
1077 |
\& 'book.price', {if => sub { length $_[0] }} |
|
1078 |
\& ] |
|
1079 |
\& ); |
|
1080 |
.Ve |
|
1081 |
.Sp |
|
1082 |
Map paramters to other key and value. First argument is original |
|
1083 |
parameter. this is hash reference. Rest argument is mapping. |
|
1084 |
By default, Mapping is done if the value length is not zero. |
|
1085 |
.IP "Key mapping" 4 |
|
1086 |
.IX Item "Key mapping" |
|
1087 |
.Vb 1 |
|
1088 |
\& 'id' => 'book.id' |
|
1089 |
.Ve |
|
1090 |
.Sp |
|
1091 |
This is only key mapping. Value is same as original one. |
|
1092 |
.Sp |
|
1093 |
.Vb 1 |
|
1094 |
\& (id => 1) is mapped to ('book.id' => 1) if value length is not zero. |
|
1095 |
.Ve |
|
1096 |
.IP "Key and value mapping" 4 |
|
1097 |
.IX Item "Key and value mapping" |
|
1098 |
.Vb 1 |
|
1099 |
\& 'author' => ['book.author' => sub { '%' . $_[0] . '%' }] |
|
1100 |
.Ve |
|
1101 |
.Sp |
|
1102 |
This is key and value mapping. Frist element of array reference |
|
1103 |
is mapped key name, second element is code reference to map the value. |
|
1104 |
.Sp |
|
1105 |
.Vb 2 |
|
1106 |
\& (author => 'Ken') is mapped to ('book.author' => '%Ken%') |
|
1107 |
\& if value length is not zero. |
|
1108 |
.Ve |
|
1109 |
.IP "Condition" 4 |
|
1110 |
.IX Item "Condition" |
|
1111 |
.Vb 3 |
|
1112 |
\& 'price' => ['book.price', {if => 'exists'}] |
|
1113 |
\& 'price' => ['book.price', sub { '%' . $_[0] . '%' }, {if => 'exists'}] |
|
1114 |
\& 'price' => ['book.price', {if => sub { defined shift }}] |
|
1115 |
.Ve |
|
1116 |
.Sp |
|
1117 |
If you need condition, you can sepecify it. this is code reference |
|
1118 |
or 'exists'. By default, condition is the following one. |
|
1119 |
.Sp |
|
1120 |
.Vb 1 |
|
1121 |
\& sub { defined $_[0] && length $_[0] } |
|
1122 |
.Ve |
|
1123 |
.RE |
|
1124 |
.RS 4 |
|
1125 |
.ie n .Sh """merge_param""" |
|
1126 |
.el .Sh "\f(CWmerge_param\fP" |
|
1127 |
.IX Subsection "merge_param" |
|
1128 |
.Vb 1 |
|
1129 |
\& my $param = $dbi->merge_param({key1 => 1}, {key1 => 1, key2 => 2}); |
|
1130 |
.Ve |
|
1131 |
.Sp |
|
1132 |
Merge parameters. |
|
1133 |
.Sp |
|
1134 |
.Vb 1 |
|
1135 |
\& {key1 => [1, 1], key2 => 2} |
|
1136 |
.Ve |
|
1137 |
.ie n .Sh """method""" |
|
1138 |
.el .Sh "\f(CWmethod\fP" |
|
1139 |
.IX Subsection "method" |
|
1140 |
.Vb 3 |
|
1141 |
\& $dbi->method( |
|
1142 |
\& update_or_insert => sub { |
|
1143 |
\& my $self = shift; |
|
1144 |
.Ve |
|
1145 |
.Sp |
|
1146 |
.Vb 4 |
|
1147 |
\& # Process |
|
1148 |
\& }, |
|
1149 |
\& find_or_create => sub { |
|
1150 |
\& my $self = shift; |
|
1151 |
.Ve |
|
1152 |
.Sp |
|
1153 |
.Vb 3 |
|
1154 |
\& # Process |
|
1155 |
\& } |
|
1156 |
\& ); |
|
1157 |
.Ve |
|
1158 |
.Sp |
|
1159 |
Register method. These method is called directly from DBIx::Custom object. |
|
1160 |
.Sp |
|
1161 |
.Vb 2 |
|
1162 |
\& $dbi->update_or_insert; |
|
1163 |
\& $dbi->find_or_create; |
|
1164 |
.Ve |
|
1165 |
.ie n .Sh """model""" |
|
1166 |
.el .Sh "\f(CWmodel\fP" |
|
1167 |
.IX Subsection "model" |
|
1168 |
.Vb 1 |
|
1169 |
\& my $model = $dbi->model('book'); |
|
1170 |
.Ve |
|
1171 |
.Sp |
|
1172 |
Get a DBIx::Custom::Model object, |
|
1173 |
.ie n .Sh """mycolumn""" |
|
1174 |
.el .Sh "\f(CWmycolumn\fP" |
|
1175 |
.IX Subsection "mycolumn" |
|
1176 |
.Vb 1 |
|
1177 |
\& my $column = $self->mycolumn(book => ['author', 'title']); |
|
1178 |
.Ve |
|
1179 |
.Sp |
|
1180 |
Create column clause for myself. The follwoing column clause is created. |
|
1181 |
.Sp |
|
1182 |
.Vb 2 |
|
1183 |
\& book.author as author, |
|
1184 |
\& book.title as title |
|
1185 |
.Ve |
|
1186 |
.ie n .Sh """new""" |
|
1187 |
.el .Sh "\f(CWnew\fP" |
|
1188 |
.IX Subsection "new" |
|
1189 |
.Vb 6 |
|
1190 |
\& my $dbi = DBIx::Custom->new( |
|
1191 |
\& dsn => "dbi:mysql:database=dbname", |
|
1192 |
\& user => 'ken', |
|
1193 |
\& password => '!LFKD%$&', |
|
1194 |
\& dbi_option => {mysql_enable_utf8 => 1} |
|
1195 |
\& ); |
|
1196 |
.Ve |
|
1197 |
.Sp |
|
1198 |
Create a new DBIx::Custom object. |
|
1199 |
.ie n .Sh """not_exists""" |
|
1200 |
.el .Sh "\f(CWnot_exists\fP" |
|
1201 |
.IX Subsection "not_exists" |
|
1202 |
.Vb 1 |
|
1203 |
\& my $not_exists = $dbi->not_exists; |
|
1204 |
.Ve |
|
1205 |
.Sp |
|
1206 |
DBIx::Custom::NotExists object, indicating the column is not exists. |
|
1207 |
This is used by \f(CW\*(C`clause\*(C'\fR of DBIx::Custom::Where . |
|
1208 |
.ie n .Sh """order"" \s-1EXPERIMENTAL\s0" |
|
1209 |
.el .Sh "\f(CWorder\fP \s-1EXPERIMENTAL\s0" |
|
1210 |
.IX Subsection "order EXPERIMENTAL" |
|
1211 |
.Vb 1 |
|
1212 |
\& my $order = $dbi->order; |
|
1213 |
.Ve |
|
1214 |
.Sp |
|
1215 |
Create a new DBIx::Custom::Order object. |
|
1216 |
.ie n .Sh """register_filter""" |
|
1217 |
.el .Sh "\f(CWregister_filter\fP" |
|
1218 |
.IX Subsection "register_filter" |
|
1219 |
.Vb 12 |
|
1220 |
\& $dbi->register_filter( |
|
1221 |
\& # Time::Piece object to database DATE format |
|
1222 |
\& tp_to_date => sub { |
|
1223 |
\& my $tp = shift; |
|
1224 |
\& return $tp->strftime('%Y-%m-%d'); |
|
1225 |
\& }, |
|
1226 |
\& # database DATE format to Time::Piece object |
|
1227 |
\& date_to_tp => sub { |
|
1228 |
\& my $date = shift; |
|
1229 |
\& return Time::Piece->strptime($date, '%Y-%m-%d'); |
|
1230 |
\& } |
|
1231 |
\& ); |
|
1232 |
.Ve |
|
1233 |
.Sp |
|
1234 |
Register filters, used by \f(CW\*(C`filter\*(C'\fR option of many methods. |
|
1235 |
.ie n .Sh """type_rule"" \s-1EXPERIMENTAL\s0" |
|
1236 |
.el .Sh "\f(CWtype_rule\fP \s-1EXPERIMENTAL\s0" |
|
1237 |
.IX Subsection "type_rule EXPERIMENTAL" |
|
1238 |
.Vb 22 |
|
1239 |
\& $dbi->type_rule( |
|
1240 |
\& into1 => { |
|
1241 |
\& date => sub { ... }, |
|
1242 |
\& datetime => sub { ... } |
|
1243 |
\& }, |
|
1244 |
\& into2 => { |
|
1245 |
\& date => sub { ... }, |
|
1246 |
\& datetime => sub { ... } |
|
1247 |
\& }, |
|
1248 |
\& from1 => { |
|
1249 |
\& # DATE |
|
1250 |
\& 9 => sub { ... }, |
|
1251 |
\& # DATETIME or TIMESTAMP |
|
1252 |
\& 11 => sub { ... }, |
|
1253 |
\& } |
|
1254 |
\& from2 => { |
|
1255 |
\& # DATE |
|
1256 |
\& 9 => sub { ... }, |
|
1257 |
\& # DATETIME or TIMESTAMP |
|
1258 |
\& 11 => sub { ... }, |
|
1259 |
\& } |
|
1260 |
\& ); |
|
1261 |
.Ve |
|
1262 |
.Sp |
|
1263 |
Filtering rule when data is send into and get from database. |
|
1264 |
This has a little complex problem. |
|
1265 |
.Sp |
|
1266 |
In \f(CW\*(C`into1\*(C'\fR and \f(CW\*(C`into2\*(C'\fR you can specify |
|
1267 |
type name as same as type name defined |
|
1268 |
by create table, such as \f(CW\*(C`DATETIME\*(C'\fR or \f(CW\*(C`DATE\*(C'\fR. |
|
1269 |
.Sp |
|
1270 |
Note that type name and data type don't contain upper case. |
|
1271 |
If these contain upper case charactor, you convert it to lower case. |
|
1272 |
.Sp |
|
1273 |
\&\f(CW\*(C`into2\*(C'\fR is executed after \f(CW\*(C`into1\*(C'\fR. |
|
1274 |
.Sp |
|
1275 |
Type rule of \f(CW\*(C`into1\*(C'\fR and \f(CW\*(C`into2\*(C'\fR is enabled on the following |
|
1276 |
column name. |
|
1277 |
.IP "1. column name" 4 |
|
1278 |
.IX Item "1. column name" |
|
1279 |
.Vb 2 |
|
1280 |
\& issue_date |
|
1281 |
\& issue_datetime |
|
1282 |
.Ve |
|
1283 |
.Sp |
|
1284 |
This need \f(CW\*(C`table\*(C'\fR option in each method. |
|
1285 |
.IP "2. table name and column name, separator is dot" 4 |
|
1286 |
.IX Item "2. table name and column name, separator is dot" |
|
1287 |
.Vb 2 |
|
1288 |
\& book.issue_date |
|
1289 |
\& book.issue_datetime |
|
1290 |
.Ve |
|
1291 |
.RE |
|
1292 |
.RS 4 |
|
1293 |
.Sp |
|
1294 |
You get all type name used in database by \f(CW\*(C`available_type_name\*(C'\fR. |
|
1295 |
.Sp |
|
1296 |
.Vb 1 |
|
1297 |
\& print $dbi->available_type_name; |
|
1298 |
.Ve |
|
1299 |
.Sp |
|
1300 |
In \f(CW\*(C`from1\*(C'\fR and \f(CW\*(C`from2\*(C'\fR you specify data type, not type name. |
|
1301 |
\&\f(CW\*(C`from2\*(C'\fR is executed after \f(CW\*(C`from1\*(C'\fR. |
|
1302 |
You get all data type by \f(CW\*(C`available_data_type\*(C'\fR. |
|
1303 |
.Sp |
|
1304 |
.Vb 1 |
|
1305 |
\& print $dbi->available_data_type; |
|
1306 |
.Ve |
|
1307 |
.Sp |
|
1308 |
You can also specify multiple types at once. |
|
1309 |
.Sp |
|
1310 |
.Vb 5 |
|
1311 |
\& $dbi->type_rule( |
|
1312 |
\& into1 => [ |
|
1313 |
\& [qw/DATE DATETIME/] => sub { ... }, |
|
1314 |
\& ], |
|
1315 |
\& ); |
|
1316 |
.Ve |
|
1317 |
.ie n .Sh """select""" |
|
1318 |
.el .Sh "\f(CWselect\fP" |
|
1319 |
.IX Subsection "select" |
|
1320 |
.Vb 5 |
|
1321 |
\& my $result = $dbi->select( |
|
1322 |
\& table => 'book', |
|
1323 |
\& column => ['author', 'title'], |
|
1324 |
\& where => {author => 'Ken'}, |
|
1325 |
\& ); |
|
1326 |
.Ve |
|
1327 |
.Sp |
|
1328 |
Execute select statement. |
|
1329 |
.Sp |
|
1330 |
The following opitons are available. |
|
1331 |
.ie n .IP """append""" 4 |
|
1332 |
.el .IP "\f(CWappend\fR" 4 |
|
1333 |
.IX Item "append" |
|
1334 |
.Vb 1 |
|
1335 |
\& append => 'order by title' |
|
1336 |
.Ve |
|
1337 |
.Sp |
|
1338 |
Append statement to last of \s-1SQL\s0. |
|
1339 |
.ie n .IP """column""" 4 |
|
1340 |
.el .IP "\f(CWcolumn\fR" 4 |
|
1341 |
.IX Item "column" |
|
1342 |
.Vb 2 |
|
1343 |
\& column => 'author' |
|
1344 |
\& column => ['author', 'title'] |
|
1345 |
.Ve |
|
1346 |
.Sp |
|
1347 |
Column clause. |
|
1348 |
.Sp |
|
1349 |
if \f(CW\*(C`column\*(C'\fR is not specified, '*' is set. |
|
1350 |
.Sp |
|
1351 |
.Vb 1 |
|
1352 |
\& column => '*' |
|
1353 |
.Ve |
|
1354 |
.Sp |
|
1355 |
You can specify hash of array reference. |
|
1356 |
.Sp |
|
1357 |
.Vb 4 |
|
1358 |
\& column => [ |
|
1359 |
\& {book => [qw/author title/]}, |
|
1360 |
\& {person => [qw/name age/]} |
|
1361 |
\& ] |
|
1362 |
.Ve |
|
1363 |
.Sp |
|
1364 |
This is expanded to the following one by using \f(CW\*(C`colomn\*(C'\fR method. |
|
1365 |
.Sp |
|
1366 |
.Vb 4 |
|
1367 |
\& book.author as "book.author", |
|
1368 |
\& book.title as "book.title", |
|
1369 |
\& person.name as "person.name", |
|
1370 |
\& person.age as "person.age" |
|
1371 |
.Ve |
|
1372 |
.Sp |
|
1373 |
You can specify array of array reference, first argument is |
|
1374 |
column name, second argument is alias. |
|
1375 |
.Sp |
|
1376 |
.Vb 3 |
|
1377 |
\& column => [ |
|
1378 |
\& ['date(book.register_datetime)' => 'book.register_date'] |
|
1379 |
\& ]; |
|
1380 |
.Ve |
|
1381 |
.Sp |
|
1382 |
Alias is quoted properly and joined. |
|
1383 |
.Sp |
|
1384 |
.Vb 1 |
|
1385 |
\& date(book.register_datetime) as "book.register_date" |
|
1386 |
.Ve |
|
1387 |
.ie n .IP """filter""" 4 |
|
1388 |
.el .IP "\f(CWfilter\fR" 4 |
|
1389 |
.IX Item "filter" |
|
1390 |
Same as \f(CW\*(C`execute\*(C'\fR method's \f(CW\*(C`filter\*(C'\fR option. |
|
1391 |
.ie n .IP """id""" 4 |
|
1392 |
.el .IP "\f(CWid\fR" 4 |
|
1393 |
.IX Item "id" |
|
1394 |
.Vb 2 |
|
1395 |
\& id => 4 |
|
1396 |
\& id => [4, 5] |
|
1397 |
.Ve |
|
1398 |
.Sp |
|
1399 |
\&\s-1ID\s0 corresponding to \f(CW\*(C`primary_key\*(C'\fR. |
|
1400 |
You can select rows by \f(CW\*(C`id\*(C'\fR and \f(CW\*(C`primary_key\*(C'\fR. |
|
1401 |
.Sp |
|
1402 |
.Vb 5 |
|
1403 |
\& $dbi->select( |
|
1404 |
\& parimary_key => ['id1', 'id2'], |
|
1405 |
\& id => [4, 5], |
|
1406 |
\& table => 'book' |
|
1407 |
\& ); |
|
1408 |
.Ve |
|
1409 |
.Sp |
|
1410 |
The above is same as the followin one. |
|
1411 |
.Sp |
|
1412 |
.Vb 4 |
|
1413 |
\& $dbi->select( |
|
1414 |
\& where => {id1 => 4, id2 => 5}, |
|
1415 |
\& table => 'book' |
|
1416 |
\& ); |
|
1417 |
.Ve |
|
1418 |
.ie n .IP """param"" \s-1EXPERIMETNAL\s0" 4 |
|
1419 |
.el .IP "\f(CWparam\fR \s-1EXPERIMETNAL\s0" 4 |
|
1420 |
.IX Item "param EXPERIMETNAL" |
|
1421 |
.Vb 1 |
|
1422 |
\& param => {'table2.key3' => 5} |
|
1423 |
.Ve |
|
1424 |
.Sp |
|
1425 |
Parameter shown before where clause. |
|
1426 |
.Sp |
|
1427 |
For example, if you want to contain tag in join clause, |
|
1428 |
you can pass parameter by \f(CW\*(C`param\*(C'\fR option. |
|
1429 |
.Sp |
|
1430 |
.Vb 2 |
|
1431 |
\& join => ['inner join (select * from table2 where table2.key3 = :table2.key3)' . |
|
1432 |
\& ' as table2 on table1.key1 = table2.key1'] |
|
1433 |
.Ve |
|
1434 |
.Sp |
|
1435 |
.Vb 1 |
|
1436 |
\& prefix => 'SQL_CALC_FOUND_ROWS' |
|
1437 |
.Ve |
|
1438 |
.Sp |
|
1439 |
Prefix of column cluase |
|
1440 |
.Sp |
|
1441 |
.Vb 1 |
|
1442 |
\& select SQL_CALC_FOUND_ROWS title, author from book; |
|
1443 |
.Ve |
|
1444 |
.ie n .IP """join""" 4 |
|
1445 |
.el .IP "\f(CWjoin\fR" 4 |
|
1446 |
.IX Item "join" |
|
1447 |
.Vb 4 |
|
1448 |
\& join => [ |
|
1449 |
\& 'left outer join company on book.company_id = company_id', |
|
1450 |
\& 'left outer join location on company.location_id = location.id' |
|
1451 |
\& ] |
|
1452 |
.Ve |
|
1453 |
.Sp |
|
1454 |
Join clause. If column cluase or where clause contain table name like \*(L"company.name\*(R", |
|
1455 |
join clausees needed when \s-1SQL\s0 is created is used automatically. |
|
1456 |
.Sp |
|
1457 |
.Vb 9 |
|
1458 |
\& $dbi->select( |
|
1459 |
\& table => 'book', |
|
1460 |
\& column => ['company.location_id as location_id'], |
|
1461 |
\& where => {'company.name' => 'Orange'}, |
|
1462 |
\& join => [ |
|
1463 |
\& 'left outer join company on book.company_id = company.id', |
|
1464 |
\& 'left outer join location on company.location_id = location.id' |
|
1465 |
\& ] |
|
1466 |
\& ); |
|
1467 |
.Ve |
|
1468 |
.Sp |
|
1469 |
In above select, column and where clause contain \*(L"company\*(R" table, |
|
1470 |
the following \s-1SQL\s0 is created |
|
1471 |
.Sp |
|
1472 |
.Vb 4 |
|
1473 |
\& select company.location_id as location_id |
|
1474 |
\& from book |
|
1475 |
\& left outer join company on book.company_id = company.id |
|
1476 |
\& where company.name = ?; |
|
1477 |
.Ve |
|
1478 |
.Sp |
|
1479 |
You can specify two table by yourself. This is useful when join parser can't parse |
|
1480 |
the join clause correctly. This is \s-1EXPERIMENTAL\s0. |
|
1481 |
.Sp |
|
1482 |
.Vb 11 |
|
1483 |
\& $dbi->select( |
|
1484 |
\& table => 'book', |
|
1485 |
\& column => ['company.location_id as location_id'], |
|
1486 |
\& where => {'company.name' => 'Orange'}, |
|
1487 |
\& join => [ |
|
1488 |
\& { |
|
1489 |
\& clause => 'left outer join location on company.location_id = location.id', |
|
1490 |
\& table => ['company', 'location'] |
|
1491 |
\& } |
|
1492 |
\& ] |
|
1493 |
\& ); |
|
1494 |
.Ve |
|
1495 |
.ie n .IP """primary_key""" 4 |
|
1496 |
.el .IP "\f(CWprimary_key\fR" 4 |
|
1497 |
.IX Item "primary_key" |
|
1498 |
.Vb 2 |
|
1499 |
\& primary_key => 'id' |
|
1500 |
\& primary_key => ['id1', 'id2'] |
|
1501 |
.Ve |
|
1502 |
.Sp |
|
1503 |
Primary key. This is used by \f(CW\*(C`id\*(C'\fR option. |
|
1504 |
.ie n .IP """query""" 4 |
|
1505 |
.el .IP "\f(CWquery\fR" 4 |
|
1506 |
.IX Item "query" |
|
1507 |
Same as \f(CW\*(C`execute\*(C'\fR method's \f(CW\*(C`query\*(C'\fR option. |
|
1508 |
.ie n .IP """bind_type""" 4 |
|
1509 |
.el .IP "\f(CWbind_type\fR" 4 |
|
1510 |
.IX Item "bind_type" |
|
1511 |
Same as \f(CW\*(C`execute\*(C'\fR method's \f(CW\*(C`bind_type\*(C'\fR option. |
|
1512 |
.ie n .IP """table""" 4 |
|
1513 |
.el .IP "\f(CWtable\fR" 4 |
|
1514 |
.IX Item "table" |
|
1515 |
.Vb 1 |
|
1516 |
\& table => 'book' |
|
1517 |
.Ve |
|
1518 |
.Sp |
|
1519 |
Table name. |
|
1520 |
.ie n .IP """type_rule_off"" \s-1EXPERIMENTAL\s0" 4 |
|
1521 |
.el .IP "\f(CWtype_rule_off\fR \s-1EXPERIMENTAL\s0" 4 |
|
1522 |
.IX Item "type_rule_off EXPERIMENTAL" |
|
1523 |
Same as \f(CW\*(C`execute\*(C'\fR method's \f(CW\*(C`type_rule_off\*(C'\fR option. |
|
1524 |
.ie n .IP """type_rule1_off"" \s-1EXPERIMENTAL\s0" 4 |
|
1525 |
.el .IP "\f(CWtype_rule1_off\fR \s-1EXPERIMENTAL\s0" 4 |
|
1526 |
.IX Item "type_rule1_off EXPERIMENTAL" |
|
1527 |
.Vb 1 |
|
1528 |
\& type_rule1_off => 1 |
|
1529 |
.Ve |
|
1530 |
.Sp |
|
1531 |
Same as \f(CW\*(C`execute\*(C'\fR method's \f(CW\*(C`type_rule1_off\*(C'\fR option. |
|
1532 |
.ie n .IP """type_rule2_off"" \s-1EXPERIMENTAL\s0" 4 |
|
1533 |
.el .IP "\f(CWtype_rule2_off\fR \s-1EXPERIMENTAL\s0" 4 |
|
1534 |
.IX Item "type_rule2_off EXPERIMENTAL" |
|
1535 |
.Vb 1 |
|
1536 |
\& type_rule2_off => 1 |
|
1537 |
.Ve |
|
1538 |
.Sp |
|
1539 |
Same as \f(CW\*(C`execute\*(C'\fR method's \f(CW\*(C`type_rule2_off\*(C'\fR option. |
|
1540 |
.ie n .IP """where""" 4 |
|
1541 |
.el .IP "\f(CWwhere\fR" 4 |
|
1542 |
.IX Item "where" |
|
1543 |
.Vb 2 |
|
1544 |
\& # Hash refrence |
|
1545 |
\& where => {author => 'Ken', 'title' => 'Perl'} |
|
1546 |
.Ve |
|
1547 |
.Sp |
|
1548 |
.Vb 5 |
|
1549 |
\& # DBIx::Custom::Where object |
|
1550 |
\& where => $dbi->where( |
|
1551 |
\& clause => ['and', 'author = :author', 'title like :title'], |
|
1552 |
\& param => {author => 'Ken', title => '%Perl%'} |
|
1553 |
\& ); |
|
1554 |
.Ve |
|
1555 |
.Sp |
|
1556 |
.Vb 5 |
|
1557 |
\& # Array reference 1 (array reference, hash referenc). same as above |
|
1558 |
\& where => [ |
|
1559 |
\& ['and', 'author = :author', 'title like :title'], |
|
1560 |
\& {author => 'Ken', title => '%Perl%'} |
|
1561 |
\& ]; |
|
1562 |
.Ve |
|
1563 |
.Sp |
|
1564 |
.Vb 5 |
|
1565 |
\& # Array reference 2 (String, hash reference) |
|
1566 |
\& where => [ |
|
1567 |
\& 'title like :title', |
|
1568 |
\& {title => '%Perl%'} |
|
1569 |
\& ] |
|
1570 |
.Ve |
|
1571 |
.Sp |
|
1572 |
.Vb 2 |
|
1573 |
\& # String |
|
1574 |
\& where => 'title is null' |
|
1575 |
.Ve |
|
1576 |
.Sp |
|
1577 |
Where clause. |
|
1578 |
.ie n .IP """wrap"" \s-1EXPERIMENTAL\s0" 4 |
|
1579 |
.el .IP "\f(CWwrap\fR \s-1EXPERIMENTAL\s0" 4 |
|
1580 |
.IX Item "wrap EXPERIMENTAL" |
|
1581 |
Wrap statement. This is array reference. |
|
1582 |
.Sp |
|
1583 |
.Vb 1 |
|
1584 |
\& $dbi->select(wrap => ['select * from (', ') as t where ROWNUM < 10']); |
|
1585 |
.Ve |
|
1586 |
.Sp |
|
1587 |
This option is for Oracle and \s-1SQL\s0 Server paging process. |
|
1588 |
.RE |
|
1589 |
.RS 4 |
|
1590 |
.ie n .Sh """update""" |
|
1591 |
.el .Sh "\f(CWupdate\fP" |
|
1592 |
.IX Subsection "update" |
|
1593 |
.Vb 1 |
|
1594 |
\& $dbi->update({title => 'Perl'}, table => 'book', where => {id => 4}); |
|
1595 |
.Ve |
|
1596 |
.Sp |
|
1597 |
Execute update statement. First argument is update row data. |
|
1598 |
.Sp |
|
1599 |
If you want to set constant value to row data, use scalar reference |
|
1600 |
as parameter value. |
|
1601 |
.Sp |
|
1602 |
.Vb 1 |
|
1603 |
\& {date => \e"NOW()"} |
|
1604 |
.Ve |
|
1605 |
.Sp |
|
1606 |
The following opitons are available. |
|
1607 |
.ie n .IP """append""" 4 |
|
1608 |
.el .IP "\f(CWappend\fR" 4 |
|
1609 |
.IX Item "append" |
|
1610 |
Same as \f(CW\*(C`select\*(C'\fR method's \f(CW\*(C`append\*(C'\fR option. |
|
1611 |
.ie n .IP """filter""" 4 |
|
1612 |
.el .IP "\f(CWfilter\fR" 4 |
|
1613 |
.IX Item "filter" |
|
1614 |
Same as \f(CW\*(C`execute\*(C'\fR method's \f(CW\*(C`filter\*(C'\fR option. |
|
1615 |
.ie n .IP """id""" 4 |
|
1616 |
.el .IP "\f(CWid\fR" 4 |
|
1617 |
.IX Item "id" |
|
1618 |
.Vb 2 |
|
1619 |
\& id => 4 |
|
1620 |
\& id => [4, 5] |
|
1621 |
.Ve |
|
1622 |
.Sp |
|
1623 |
\&\s-1ID\s0 corresponding to \f(CW\*(C`primary_key\*(C'\fR. |
|
1624 |
You can update rows by \f(CW\*(C`id\*(C'\fR and \f(CW\*(C`primary_key\*(C'\fR. |
|
1625 |
.Sp |
|
1626 |
.Vb 6 |
|
1627 |
\& $dbi->update( |
|
1628 |
\& {title => 'Perl', author => 'Ken'} |
|
1629 |
\& parimary_key => ['id1', 'id2'], |
|
1630 |
\& id => [4, 5], |
|
1631 |
\& table => 'book' |
|
1632 |
\& ); |
|
1633 |
.Ve |
|
1634 |
.Sp |
|
1635 |
The above is same as the followin one. |
|
1636 |
.Sp |
|
1637 |
.Vb 5 |
|
1638 |
\& $dbi->update( |
|
1639 |
\& {title => 'Perl', author => 'Ken'} |
|
1640 |
\& where => {id1 => 4, id2 => 5}, |
|
1641 |
\& table => 'book' |
|
1642 |
\& ); |
|
1643 |
.Ve |
|
1644 |
.ie n .IP """prefix""" 4 |
|
1645 |
.el .IP "\f(CWprefix\fR" 4 |
|
1646 |
.IX Item "prefix" |
|
1647 |
.Vb 1 |
|
1648 |
\& prefix => 'or replace' |
|
1649 |
.Ve |
|
1650 |
.Sp |
|
1651 |
prefix before table name section |
|
1652 |
.Sp |
|
1653 |
.Vb 1 |
|
1654 |
\& update or replace book |
|
1655 |
.Ve |
|
1656 |
.ie n .IP """primary_key""" 4 |
|
1657 |
.el .IP "\f(CWprimary_key\fR" 4 |
|
1658 |
.IX Item "primary_key" |
|
1659 |
.Vb 2 |
|
1660 |
\& primary_key => 'id' |
|
1661 |
\& primary_key => ['id1', 'id2'] |
|
1662 |
.Ve |
|
1663 |
.Sp |
|
1664 |
Primary key. This is used by \f(CW\*(C`id\*(C'\fR option. |
|
1665 |
.ie n .IP """query""" 4 |
|
1666 |
.el .IP "\f(CWquery\fR" 4 |
|
1667 |
.IX Item "query" |
|
1668 |
Same as \f(CW\*(C`execute\*(C'\fR method's \f(CW\*(C`query\*(C'\fR option. |
|
1669 |
.ie n .IP """table""" 4 |
|
1670 |
.el .IP "\f(CWtable\fR" 4 |
|
1671 |
.IX Item "table" |
|
1672 |
.Vb 1 |
|
1673 |
\& table => 'book' |
|
1674 |
.Ve |
|
1675 |
.Sp |
|
1676 |
Table name. |
|
1677 |
.ie n .IP """where""" 4 |
|
1678 |
.el .IP "\f(CWwhere\fR" 4 |
|
1679 |
.IX Item "where" |
|
1680 |
Same as \f(CW\*(C`select\*(C'\fR method's \f(CW\*(C`where\*(C'\fR option. |
|
1681 |
.ie n .IP """bind_type""" 4 |
|
1682 |
.el .IP "\f(CWbind_type\fR" 4 |
|
1683 |
.IX Item "bind_type" |
|
1684 |
Same as \f(CW\*(C`execute\*(C'\fR method's \f(CW\*(C`bind_type\*(C'\fR option. |
|
1685 |
.ie n .IP """type_rule_off"" \s-1EXPERIMENTAL\s0" 4 |
|
1686 |
.el .IP "\f(CWtype_rule_off\fR \s-1EXPERIMENTAL\s0" 4 |
|
1687 |
.IX Item "type_rule_off EXPERIMENTAL" |
|
1688 |
Same as \f(CW\*(C`execute\*(C'\fR method's \f(CW\*(C`type_rule_off\*(C'\fR option. |
|
1689 |
.ie n .IP """type_rule1_off"" \s-1EXPERIMENTAL\s0" 4 |
|
1690 |
.el .IP "\f(CWtype_rule1_off\fR \s-1EXPERIMENTAL\s0" 4 |
|
1691 |
.IX Item "type_rule1_off EXPERIMENTAL" |
|
1692 |
.Vb 1 |
|
1693 |
\& type_rule1_off => 1 |
|
1694 |
.Ve |
|
1695 |
.Sp |
|
1696 |
Same as \f(CW\*(C`execute\*(C'\fR method's \f(CW\*(C`type_rule1_off\*(C'\fR option. |
|
1697 |
.ie n .IP """type_rule2_off"" \s-1EXPERIMENTAL\s0" 4 |
|
1698 |
.el .IP "\f(CWtype_rule2_off\fR \s-1EXPERIMENTAL\s0" 4 |
|
1699 |
.IX Item "type_rule2_off EXPERIMENTAL" |
|
1700 |
.Vb 1 |
|
1701 |
\& type_rule2_off => 1 |
|
1702 |
.Ve |
|
1703 |
.Sp |
|
1704 |
Same as \f(CW\*(C`execute\*(C'\fR method's \f(CW\*(C`type_rule2_off\*(C'\fR option. |
|
1705 |
.RE |
|
1706 |
.RS 4 |
|
1707 |
.ie n .Sh """update_all""" |
|
1708 |
.el .Sh "\f(CWupdate_all\fP" |
|
1709 |
.IX Subsection "update_all" |
|
1710 |
.Vb 1 |
|
1711 |
\& $dbi->update_all({title => 'Perl'}, table => 'book', ); |
|
1712 |
.Ve |
|
1713 |
.Sp |
|
1714 |
Execute update statement for all rows. |
|
1715 |
Options is same as \f(CW\*(C`update\*(C'\fR method. |
|
1716 |
.ie n .Sh """update_param""" |
|
1717 |
.el .Sh "\f(CWupdate_param\fP" |
|
1718 |
.IX Subsection "update_param" |
|
1719 |
.Vb 1 |
|
1720 |
\& my $update_param = $dbi->update_param({title => 'a', age => 2}); |
|
1721 |
.Ve |
|
1722 |
.Sp |
|
1723 |
Create update parameter tag. |
|
1724 |
.Sp |
|
1725 |
.Vb 1 |
|
1726 |
\& set title = :title, author = :author |
|
1727 |
.Ve |
|
1728 |
.ie n .Sh """where""" |
|
1729 |
.el .Sh "\f(CWwhere\fP" |
|
1730 |
.IX Subsection "where" |
|
1731 |
.Vb 4 |
|
1732 |
\& my $where = $dbi->where( |
|
1733 |
\& clause => ['and', 'title = :title', 'author = :author'], |
|
1734 |
\& param => {title => 'Perl', author => 'Ken'} |
|
1735 |
\& ); |
|
1736 |
.Ve |
|
1737 |
.Sp |
|
1738 |
Create a new DBIx::Custom::Where object. |
|
1739 |
.ie n .Sh """setup_model""" |
|
1740 |
.el .Sh "\f(CWsetup_model\fP" |
|
1741 |
.IX Subsection "setup_model" |
|
1742 |
.Vb 1 |
|
1743 |
\& $dbi->setup_model; |
|
1744 |
.Ve |
|
1745 |
.Sp |
|
1746 |
Setup all model objects. |
|
1747 |
\&\f(CW\*(C`columns\*(C'\fR of model object is automatically set, parsing database information. |
|
1748 |
.SH "ENVIRONMENT VARIABLE" |
|
1749 |
.IX Header "ENVIRONMENT VARIABLE" |
|
1750 |
.ie n .Sh """DBIX_CUSTOM_DEBUG""" |
|
1751 |
.el .Sh "\f(CWDBIX_CUSTOM_DEBUG\fP" |
|
1752 |
.IX Subsection "DBIX_CUSTOM_DEBUG" |
|
1753 |
If environment variable \f(CW\*(C`DBIX_CUSTOM_DEBUG\*(C'\fR is set to true, |
|
1754 |
executed \s-1SQL\s0 and bind values are printed to \s-1STDERR\s0. |
|
1755 |
.ie n .Sh """DBIX_CUSTOM_DEBUG_ENCODING""" |
|
1756 |
.el .Sh "\f(CWDBIX_CUSTOM_DEBUG_ENCODING\fP" |
|
1757 |
.IX Subsection "DBIX_CUSTOM_DEBUG_ENCODING" |
|
1758 |
\&\s-1DEBUG\s0 output encoding. Default to \s-1UTF\-8\s0. |
|
1759 |
.SH "DEPRECATED FUNCTIONALITIES" |
|
1760 |
.IX Header "DEPRECATED FUNCTIONALITIES" |
|
1761 |
DBIx::Custom |
|
1762 |
.Sp |
|
1763 |
.Vb 6 |
|
1764 |
\& # Attribute methods |
|
1765 |
\& data_source # will be removed at 2017/1/1 |
|
1766 |
\& dbi_options # will be removed at 2017/1/1 |
|
1767 |
\& filter_check # will be removed at 2017/1/1 |
|
1768 |
\& reserved_word_quote # will be removed at 2017/1/1 |
|
1769 |
\& cache_method # will be removed at 2017/1/1 |
|
1770 |
.Ve |
|
1771 |
.Sp |
|
1772 |
.Vb 13 |
|
1773 |
\& # Methods |
|
1774 |
\& create_query # will be removed at 2017/1/1 |
|
1775 |
\& apply_filter # will be removed at 2017/1/1 |
|
1776 |
\& select_at # will be removed at 2017/1/1 |
|
1777 |
\& delete_at # will be removed at 2017/1/1 |
|
1778 |
\& update_at # will be removed at 2017/1/1 |
|
1779 |
\& insert_at # will be removed at 2017/1/1 |
|
1780 |
\& register_tag # will be removed at 2017/1/1 |
|
1781 |
\& default_bind_filter # will be removed at 2017/1/1 |
|
1782 |
\& default_fetch_filter # will be removed at 2017/1/1 |
|
1783 |
\& insert_param_tag # will be removed at 2017/1/1 |
|
1784 |
\& register_tag_processor # will be removed at 2017/1/1 |
|
1785 |
\& update_param_tag # will be removed at 2017/1/1 |
|
1786 |
.Ve |
|
1787 |
.Sp |
|
1788 |
.Vb 5 |
|
1789 |
\& # Options |
|
1790 |
\& select method relation option # will be removed at 2017/1/1 |
|
1791 |
\& select method param option # will be removed at 2017/1/1 |
|
1792 |
\& select method column option [COLUMN, as => ALIAS] format |
|
1793 |
\& # will be removed at 2017/1/1 |
|
1794 |
.Ve |
|
1795 |
.Sp |
|
1796 |
.Vb 5 |
|
1797 |
\& # Others |
|
1798 |
\& execute("select * from {= title}"); # execute method's |
|
1799 |
\& # tag parsing functionality |
|
1800 |
\& # will be removed at 2017/1/1 |
|
1801 |
\& Query caching # will be removed at 2017/1/1 |
|
1802 |
.Ve |
|
1803 |
.Sp |
|
1804 |
DBIx::Custom::Model |
|
1805 |
.Sp |
|
1806 |
.Vb 4 |
|
1807 |
\& # Attribute methods |
|
1808 |
\& filter # will be removed at 2017/1/1 |
|
1809 |
\& name # will be removed at 2017/1/1 |
|
1810 |
\& type # will be removed at 2017/1/1 |
|
1811 |
.Ve |
|
1812 |
.Sp |
|
1813 |
DBIx::Custom::Query |
|
1814 |
.Sp |
|
1815 |
.Vb 4 |
|
1816 |
\& # Attribute methods |
|
1817 |
\& default_filter # will be removed at 2017/1/1 |
|
1818 |
\& table # will be removed at 2017/1/1 |
|
1819 |
\& filters # will be removed at 2017/1/1 |
|
1820 |
.Ve |
|
1821 |
.Sp |
|
1822 |
.Vb 2 |
|
1823 |
\& # Methods |
|
1824 |
\& filter # will be removed at 2017/1/1 |
|
1825 |
.Ve |
|
1826 |
.Sp |
|
1827 |
DBIx::Custom::QueryBuilder |
|
1828 |
.Sp |
|
1829 |
.Vb 3 |
|
1830 |
\& # Attribute methods |
|
1831 |
\& tags # will be removed at 2017/1/1 |
|
1832 |
\& tag_processors # will be removed at 2017/1/1 |
|
1833 |
.Ve |
|
1834 |
.Sp |
|
1835 |
.Vb 3 |
|
1836 |
\& # Methods |
|
1837 |
\& register_tag # will be removed at 2017/1/1 |
|
1838 |
\& register_tag_processor # will be removed at 2017/1/1 |
|
1839 |
.Ve |
|
1840 |
.Sp |
|
1841 |
.Vb 3 |
|
1842 |
\& # Others |
|
1843 |
\& build_query("select * from {= title}"); # tag parsing functionality |
|
1844 |
\& # will be removed at 2017/1/1 |
|
1845 |
.Ve |
|
1846 |
.Sp |
|
1847 |
DBIx::Custom::Result |
|
1848 |
.Sp |
|
1849 |
.Vb 2 |
|
1850 |
\& # Attribute methods |
|
1851 |
\& filter_check # will be removed at 2017/1/1 |
|
1852 |
.Ve |
|
1853 |
.Sp |
|
1854 |
.Vb 5 |
|
1855 |
\& # Methods |
|
1856 |
\& end_filter # will be removed at 2017/1/1 |
|
1857 |
\& remove_end_filter # will be removed at 2017/1/1 |
|
1858 |
\& remove_filter # will be removed at 2017/1/1 |
|
1859 |
\& default_filter # will be removed at 2017/1/1 |
|
1860 |
.Ve |
|
1861 |
.Sp |
|
1862 |
DBIx::Custom::Tag |
|
1863 |
.Sp |
|
1864 |
.Vb 1 |
|
1865 |
\& This module is DEPRECATED! # will be removed at 2017/1/1 |
|
1866 |
.Ve |
|
1867 |
.SH "BACKWORD COMPATIBLE POLICY" |
|
1868 |
.IX Header "BACKWORD COMPATIBLE POLICY" |
|
1869 |
If a functionality is \s-1DEPRECATED\s0, you can know it by \s-1DEPRECATED\s0 warnings |
|
1870 |
except for attribute method. |
|
1871 |
You can check all \s-1DEPRECATED\s0 functionalities by document. |
|
1872 |
\&\s-1DEPRECATED\s0 functionality is removed after five years, |
|
1873 |
but if at least one person use the functionality and tell me that thing |
|
1874 |
I extend one year each time he tell me it. |
|
1875 |
.Sp |
|
1876 |
\&\s-1EXPERIMENTAL\s0 functionality will be changed without warnings. |
|
1877 |
.Sp |
|
1878 |
This policy was changed at 2011/6/28 |
|
1879 |
.SH "BUGS" |
|
1880 |
.IX Header "BUGS" |
|
1881 |
Please tell me bugs if found. |
|
1882 |
.Sp |
|
1883 |
\&\f(CW\*(C`<kimoto.yuki at gmail.com>\*(C'\fR |
|
1884 |
.Sp |
|
1885 |
<http://github.com/yuki\-kimoto/DBIx\-Custom> |
|
1886 |
.SH "AUTHOR" |
|
1887 |
.IX Header "AUTHOR" |
|
1888 |
Yuki Kimoto, \f(CW\*(C`<kimoto.yuki at gmail.com>\*(C'\fR |
|
1889 |
.SH "COPYRIGHT & LICENSE" |
|
1890 |
.IX Header "COPYRIGHT & LICENSE" |
|
1891 |
Copyright 2009\-2011 Yuki Kimoto, all rights reserved. |
|
1892 |
.Sp |
|
1893 |
This program is free software; you can redistribute it and/or modify it |
|
1894 |
under the same terms as Perl itself. |