Newer Older
615 lines | 16.905kb
packaging one directory
yuki-kimoto authored on 2009-11-16
1
package DBIx::Custom::SQL::Template;
2

            
update document
yuki-kimoto authored on 2009-11-17
3
use strict;
4
use warnings;
packaging one directory
yuki-kimoto authored on 2009-11-16
5

            
update document
yuki-kimoto authored on 2010-01-30
6
use base 'Object::Simple';
7
use Carp 'croak';
cleanup and update docment
yuki-kimoto authored on 2009-11-19
8
use DBIx::Custom::Query;
9

            
catch up with Object::Simple...
yuki-kimoto authored on 2010-01-18
10
__PACKAGE__->dual_attr('tag_processors', default => sub { {} },
catch up with Object::Simple...
yuki-kimoto authored on 2010-01-22
11
                                         inherit => 'hash_copy');
cleanup
yuki-kimoto authored on 2009-12-22
12

            
catch up with Object::Simple...
yuki-kimoto authored on 2010-01-22
13
__PACKAGE__->dual_attr('tag_start', default => '{', inherit => 'scalar_copy');
14
__PACKAGE__->dual_attr('tag_end',   default => '}', inherit => 'scalar_copy');
cleanup
yuki-kimoto authored on 2009-12-22
15

            
catch up with Object::Simple...
yuki-kimoto authored on 2010-01-22
16
__PACKAGE__->dual_attr('tag_syntax', inherit => 'scalar_copy');
cleanup
yuki-kimoto authored on 2009-12-22
17

            
catch up with Object::Simple...
yuki-kimoto authored on 2010-01-18
18
__PACKAGE__->add_tag_processor(
cleanup
yuki-kimoto authored on 2009-12-17
19
    '?'      => \&DBIx::Custom::SQL::Template::TagProcessors::expand_basic_tag,
20
    '='      => \&DBIx::Custom::SQL::Template::TagProcessors::expand_basic_tag,
21
    '<>'     => \&DBIx::Custom::SQL::Template::TagProcessors::expand_basic_tag,
22
    '>'      => \&DBIx::Custom::SQL::Template::TagProcessors::expand_basic_tag,
23
    '<'      => \&DBIx::Custom::SQL::Template::TagProcessors::expand_basic_tag,
24
    '>='     => \&DBIx::Custom::SQL::Template::TagProcessors::expand_basic_tag,
25
    '<='     => \&DBIx::Custom::SQL::Template::TagProcessors::expand_basic_tag,
26
    'like'   => \&DBIx::Custom::SQL::Template::TagProcessors::expand_basic_tag,
27
    'in'     => \&DBIx::Custom::SQL::Template::TagProcessors::expand_in_tag,
28
    'insert' => \&DBIx::Custom::SQL::Template::TagProcessors::expand_insert_tag,
29
    'update' => \&DBIx::Custom::SQL::Template::TagProcessors::expand_update_tag
30
);
packaging one directory
yuki-kimoto authored on 2009-11-16
31

            
catch up with Object::Simple...
yuki-kimoto authored on 2010-01-18
32
__PACKAGE__->tag_syntax(<< 'EOS');
packaging one directory
yuki-kimoto authored on 2009-11-16
33
[tag]                     [expand]
34
{? name}                  ?
35
{= name}                  name = ?
36
{<> name}                 name <> ?
37

            
38
{< name}                  name < ?
39
{> name}                  name > ?
40
{>= name}                 name >= ?
41
{<= name}                 name <= ?
42

            
43
{like name}               name like ?
44
{in name number}          name in [?, ?, ..]
45

            
46
{insert key1 key2} (key1, key2) values (?, ?)
47
{update key1 key2}    set key1 = ?, key2 = ?
48
EOS
49

            
50

            
51
sub add_tag_processor {
52
    my $invocant = shift;
53
    my $tag_processors = ref $_[0] eq 'HASH' ? $_[0] : {@_};
catch up with Object::Simple...
yuki-kimoto authored on 2010-01-18
54
    $invocant->tag_processors({%{$invocant->tag_processors}, %{$tag_processors}});
packaging one directory
yuki-kimoto authored on 2009-11-16
55
    return $invocant;
56
}
57

            
58
sub clone {
59
    my $self = shift;
60
    my $new = $self->new;
61
    
62
    $new->tag_start($self->tag_start);
63
    $new->tag_end($self->tag_end);
64
    $new->tag_syntax($self->tag_syntax);
65
    $new->tag_processors({%{$self->tag_processors || {}}});
66
    
67
    return $new;
68
}
69

            
70
sub create_query {
71
    my ($self, $template)  = @_;
72
    
73
    # Parse template
74
    my $tree = $self->_parse_template($template);
75
    
76
    # Build query
77
    my $query = $self->_build_query($tree);
78
    
79
    return $query;
80
}
81

            
82
sub _parse_template {
83
    my ($self, $template) = @_;
84
    $template ||= '';
85
    
86
    my $tree = [];
87
    
88
    # Tags
89
    my $tag_start = quotemeta $self->tag_start;
90
    my $tag_end   = quotemeta $self->tag_end;
91
    
92
    # Tokenize
93
    my $state = 'text';
94
    
95
    # Save original template
96
    my $original_template = $template;
97
    
98
    # Parse template
99
    while ($template =~ s/([^$tag_start]*?)$tag_start([^$tag_end].*?)$tag_end//sm) {
100
        my $text = $1;
101
        my $tag  = $2;
102
        
103
        # Parse tree
104
        push @$tree, {type => 'text', tag_args => [$text]} if $text;
105
        
106
        if ($tag) {
107
            # Get tag name and arguments
108
            my ($tag_name, @tag_args) = split /\s+/, $tag;
109
            
110
            # Tag processor is exist?
111
            unless ($self->tag_processors->{$tag_name}) {
112
                my $tag_syntax = $self->tag_syntax;
113
                croak("Tag '{$tag}' in SQL template is not exist.\n\n" .
114
                      "<SQL template tag syntax>\n" .
115
                      "$tag_syntax\n" .
116
                      "<Your SQL template>\n" .
117
                      "$original_template\n\n");
118
            }
119
            
120
            # Check tag arguments
121
            foreach my $tag_arg (@tag_args) {
122
                # Cannot cantain placehosder '?'
123
                croak("Tag '{t }' arguments cannot contain '?'")
124
                  if $tag_arg =~ /\?/;
125
            }
126
            
127
            # Add tag to parsing tree
128
            push @$tree, {type => 'tag', tag_name => $tag_name, tag_args => [@tag_args]};
129
        }
130
    }
131
    
132
    # Add text to parsing tree 
133
    push @$tree, {type => 'text', tag_args => [$template]} if $template;
134
    
135
    return $tree;
136
}
137

            
138
sub _build_query {
139
    my ($self, $tree) = @_;
140
    
141
    # SQL
142
    my $sql = '';
143
    
144
    # All parameter key infomation
145
    my $all_key_infos = [];
146
    
147
    # Build SQL 
148
    foreach my $node (@$tree) {
149
        
150
        # Get type, tag name, and arguments
151
        my $type     = $node->{type};
152
        my $tag_name = $node->{tag_name};
153
        my $tag_args = $node->{tag_args};
154
        
155
        # Text
156
        if ($type eq 'text') {
157
            # Join text
158
            $sql .= $tag_args->[0];
159
        }
160
        
161
        # Tag
162
        elsif ($type eq 'tag') {
163
            
164
            # Get tag processor
165
            my $tag_processor = $self->tag_processors->{$tag_name};
166
            
167
            # Tag processor is code ref?
168
            croak("Tag processor '$tag_name' must be code reference")
169
              unless ref $tag_processor eq 'CODE';
170
            
171
            # Expand tag using tag processor
172
            my ($expand, $key_infos)
173
              = $tag_processor->($tag_name, $tag_args);
174
            
175
            # Check tag processor return value
176
            croak("Tag processor '$tag_name' must return (\$expand, \$key_infos)")
177
              if !defined $expand || ref $key_infos ne 'ARRAY';
178
            
179
            # Check placeholder count
180
            croak("Placeholder count in SQL created by tag processor '$tag_name' " .
181
                  "must be same as key informations count")
182
              unless $self->_placeholder_count($expand) eq @$key_infos;
183
            
184
            # Add key information
185
            push @$all_key_infos, @$key_infos;
186
            
187
            # Join expand tag to SQL
188
            $sql .= $expand;
189
        }
190
    }
191
    
192
    # Add semicolon
193
    $sql .= ';' unless $sql =~ /;$/;
194
    
195
    # Query
cleanup and update docment
yuki-kimoto authored on 2009-11-19
196
    my $query = DBIx::Custom::Query->new(sql => $sql, key_infos => $all_key_infos);
packaging one directory
yuki-kimoto authored on 2009-11-16
197
    
198
    return $query;
199
}
200

            
201
sub _placeholder_count {
202
    my ($self, $expand) = @_;
203
    $expand ||= '';
204
    
205
    my $count = 0;
206
    my $pos   = -1;
207
    while (($pos = index($expand, '?', $pos + 1)) != -1) {
208
        $count++;
209
    }
210
    return $count;
211
}
212

            
cleanup
yuki-kimoto authored on 2009-12-17
213
1;
packaging one directory
yuki-kimoto authored on 2009-11-16
214

            
cleanup and update docment
yuki-kimoto authored on 2009-11-19
215
package DBIx::Custom::SQL::Template::TagProcessors;
216

            
packaging one directory
yuki-kimoto authored on 2009-11-16
217
use strict;
218
use warnings;
219
use Carp 'croak';
220

            
221
# Expand tag '?', '=', '<>', '>', '<', '>=', '<=', 'like'
222
sub expand_basic_tag {
223
    my ($tag_name, $tag_args) = @_;
224
    my $original_key = $tag_args->[0];
225
    
226
    # Key is not exist
227
    croak("You must be pass key as argument to tag '{$tag_name }'")
228
      if !$original_key;
229
    
230
    # Expanded tag
231
    my $expand = $tag_name eq '?'
232
               ? '?'
233
               : "$original_key $tag_name ?";
234
    
235
    # Get table and clumn name
236
    my ($table, $column) = get_table_and_column($original_key);
237
    
238
    # Parameter key infomation
239
    my $key_info = {};
240
    
241
    # Original key
242
    $key_info->{original_key} = $original_key;
243
    
244
    # Table
245
    $key_info->{table}  = $table;
246
    
247
    # Column name
248
    $key_info->{column} = $column;
249
    
250
    # Access keys
251
    my $access_keys = [];
252
    push @$access_keys, [$original_key];
253
    push @$access_keys, [$table, $column] if $table && $column;
254
    $key_info->{access_keys} = $access_keys;
255
    
256
    # Add parameter key information
257
    my $key_infos = [];
258
    push @$key_infos, $key_info;
259
    
260
    return ($expand, $key_infos);
261
}
262

            
263
# Expand tag 'in'
264
sub expand_in_tag {
265
    my ($tag_name, $tag_args) = @_;
266
    my ($original_key, $placeholder_count) = @$tag_args;
267
    
268
    # Key must be specified
269
    croak("You must be pass key as first argument of tag '{$tag_name }'\n" . 
270
          "Usage: {$tag_name \$key \$placeholder_count}")
271
      unless $original_key;
272
      
273
    
274
    # Place holder count must be specified
275
    croak("You must be pass placeholder count as second argument of tag '{$tag_name }'\n" . 
276
          "Usage: {$tag_name \$key \$placeholder_count}")
277
      if !$placeholder_count || $placeholder_count =~ /\D/;
278

            
279
    # Expand tag
280
    my $expand = "$original_key $tag_name (";
281
    for (my $i = 0; $i < $placeholder_count; $i++) {
282
        $expand .= '?, ';
283
    }
284
    
285
    $expand =~ s/, $//;
286
    $expand .= ')';
287
    
288
    # Get table and clumn name
289
    my ($table, $column) = get_table_and_column($original_key);
290
    
291
    # Create parameter key infomations
292
    my $key_infos = [];
293
    for (my $i = 0; $i < $placeholder_count; $i++) {
294
        # Parameter key infomation
295
        my $key_info = {};
296
        
297
        # Original key
298
        $key_info->{original_key} = $original_key;
299
        
300
        # Table
301
        $key_info->{table}   = $table;
302
        
303
        # Column name
304
        $key_info->{column}  = $column;
305
        
306
        # Access keys
307
        my $access_keys = [];
308
        push @$access_keys, [$original_key, [$i]];
309
        push @$access_keys, [$table, $column, [$i]] if $table && $column;
310
        $key_info->{access_keys} = $access_keys;
311
        
312
        # Add parameter key infos
313
        push @$key_infos, $key_info;
314
    }
315
    
316
    return ($expand, $key_infos);
317
}
318

            
319
# Get table and column
320
sub get_table_and_column {
321
    my $key = shift;
322
    $key ||= '';
323
    
324
    return ('', $key) unless $key =~ /\./;
325
    
326
    my ($table, $column) = split /\./, $key;
327
    
328
    return ($table, $column);
329
}
330

            
331
# Expand tag 'insert'
332
sub expand_insert_tag {
333
    my ($tag_name, $tag_args) = @_;
334
    my $original_keys = $tag_args;
335
    
336
    # Insert key (k1, k2, k3, ..)
337
    my $insert_keys = '(';
338
    
339
    # placeholder (?, ?, ?, ..)
340
    my $place_holders = '(';
341
    
342
    foreach my $original_key (@$original_keys) {
343
        # Get table and column
344
        my ($table, $column) = get_table_and_column($original_key);
345
        
346
        # Join insert column
347
        $insert_keys   .= "$column, ";
348
        
349
        # Join place holder
350
        $place_holders .= "?, ";
351
    }
352
    
353
    # Delete last ', '
354
    $insert_keys =~ s/, $//;
355
    
356
    # Close 
357
    $insert_keys .= ')';
358
    $place_holders =~ s/, $//;
359
    $place_holders .= ')';
360
    
361
    # Expand tag
362
    my $expand = "$insert_keys values $place_holders";
363
    
364
    # Create parameter key infomations
365
    my $key_infos = [];
366
    foreach my $original_key (@$original_keys) {
367
        # Get table and clumn name
368
        my ($table, $column) = get_table_and_column($original_key);
369
        
370
        # Parameter key infomation
371
        my $key_info = {};
372
        
373
        # Original key
374
        $key_info->{original_key} = $original_key;
375
        
376
        # Table
377
        $key_info->{table}   = $table;
378
        
379
        # Column name
380
        $key_info->{column}  = $column;
381
        
382
        # Access keys
383
        my $access_keys = [];
384
        push @$access_keys, ['#insert', $original_key];
385
        push @$access_keys, ['#insert', $table, $column] if $table && $column;
386
        push @$access_keys, [$original_key];
387
        push @$access_keys, [$table, $column] if $table && $column;
388
        $key_info->{access_keys} = $access_keys;
389
        
390
        # Add parameter key infos
391
        push @$key_infos, $key_info;
392
    }
393
    
394
    return ($expand, $key_infos);
395
}
396

            
397
# Expand tag 'update'
398
sub expand_update_tag {
399
    my ($tag_name, $tag_args) = @_;
400
    my $original_keys = $tag_args;
401
    
402
    # Expanded tag
403
    my $expand = 'set ';
404
    
405
    # 
406
    foreach my $original_key (@$original_keys) {
407
        # Get table and clumn name
408
        my ($table, $column) = get_table_and_column($original_key);
409

            
410
        # Join key and placeholder
411
        $expand .= "$column = ?, ";
412
    }
413
    
414
    # Delete last ', '
415
    $expand =~ s/, $//;
416
    
417
    # Create parameter key infomations
418
    my $key_infos = [];
419
    foreach my $original_key (@$original_keys) {
420
        # Get table and clumn name
421
        my ($table, $column) = get_table_and_column($original_key);
422
        
423
        # Parameter key infomation
424
        my $key_info = {};
425
        
426
        # Original key
427
        $key_info->{original_key} = $original_key;
428
        
429
        # Table
430
        $key_info->{table}  = $table;
431
        
432
        # Column name
433
        $key_info->{column} = $column;
434
        
435
        # Access keys
436
        my $access_keys = [];
437
        push @$access_keys, ['#update', $original_key];
438
        push @$access_keys, ['#update', $table, $column] if $table && $column;
439
        push @$access_keys, [$original_key];
440
        push @$access_keys, [$table, $column] if $table && $column;
441
        $key_info->{access_keys} = $access_keys;
442
        
443
        # Add parameter key infos
444
        push @$key_infos, $key_info;
445
    }
446
    
447
    return ($expand, $key_infos);
448
}
449

            
update document
yuki-kimoto authored on 2010-01-30
450
package DBIx::Custom::SQL::Template;
451

            
packaging one directory
yuki-kimoto authored on 2009-11-16
452
1;
453

            
454
=head1 NAME
455

            
update document
yuki-kimoto authored on 2009-11-17
456
DBIx::Custom::SQL::Template - DBIx::Custom SQL Template
packaging one directory
yuki-kimoto authored on 2009-11-16
457

            
update document
yuki-kimoto authored on 2010-01-30
458
=head1 SYNOPSIS
packaging one directory
yuki-kimoto authored on 2009-11-16
459
    
460
    my $sql_tmpl = DBIx::Custom::SQL::Template->new;
461
    
462
    my $tmpl   = "select from table {= k1} && {<> k2} || {like k3}";
463
    my $param = {k1 => 1, k2 => 2, k3 => 3};
464
    
465
    my $query = $sql_template->create_query($tmpl);
466

            
update document
yuki-kimoto authored on 2010-01-30
467
=head1 ATTRIBUTES
packaging one directory
yuki-kimoto authored on 2009-11-16
468

            
cleanup and update docment
yuki-kimoto authored on 2009-11-19
469
=head2 tag_processors
packaging one directory
yuki-kimoto authored on 2009-11-16
470

            
version 0.0901
yuki-kimoto authored on 2009-12-17
471
    $sql_tmpl       = $sql_tmpl->tag_processors($name1 => $tag_processor1
472
                                                $name2 => $tag_processor2);
473
    $tag_processors = $sql_tmpl->tag_processors;
packaging one directory
yuki-kimoto authored on 2009-11-16
474

            
475
=head2 tag_start
cleanup and update docment
yuki-kimoto authored on 2009-11-19
476
    
version 0.0901
yuki-kimoto authored on 2009-12-17
477
    $sql_tmpl  = $sql_tmpl->tag_start('{');
478
    $tag_start = $sql_tmpl->tag_start;
packaging one directory
yuki-kimoto authored on 2009-11-16
479

            
update document
yuki-kimoto authored on 2010-01-30
480
Default is '{'
packaging one directory
yuki-kimoto authored on 2009-11-16
481

            
482
=head2 tag_end
cleanup and update docment
yuki-kimoto authored on 2009-11-19
483
    
version 0.0901
yuki-kimoto authored on 2009-12-17
484
    $sql_tmpl    = $sql_tmpl->tag_start('}');
485
    $tag_end = $sql_tmpl->tag_start;
packaging one directory
yuki-kimoto authored on 2009-11-16
486

            
update document
yuki-kimoto authored on 2010-01-30
487
Default is '}'
packaging one directory
yuki-kimoto authored on 2009-11-16
488
    
489
=head2 tag_syntax
490
    
version 0.0901
yuki-kimoto authored on 2009-12-17
491
    $sql_tmpl   = $sql_tmpl->tag_syntax($tag_syntax);
492
    $tag_syntax = $sql_tmpl->tag_syntax;
packaging one directory
yuki-kimoto authored on 2009-11-16
493

            
update document
yuki-kimoto authored on 2010-01-30
494
=head1 METHODS
495

            
496
This class is L<Object::Simple> subclass.
497
You can use all methods of L<Object::Simple>
packaging one directory
yuki-kimoto authored on 2009-11-16
498

            
499
=head2 create_query
500
    
cleanup and update docment
yuki-kimoto authored on 2009-11-19
501
Create L<DBIx::Custom::Query> object parsing SQL template
502

            
version 0.0901
yuki-kimoto authored on 2009-12-17
503
    $query = $sql_tmpl->create_query($tmpl);
packaging one directory
yuki-kimoto authored on 2009-11-16
504
    
505
    # Sample
506
    $query = $sql_tmpl->create_sql(
507
         "select * from table where {= title} && {like author} || {<= price}")
508
    
cleanup and update docment
yuki-kimoto authored on 2009-11-19
509
    # Expanded
510
    $qeury->sql : "select * from table where title = ? && author like ? price <= ?;"
511
    $query->key_infos : [['title'], ['author'], ['price']]
packaging one directory
yuki-kimoto authored on 2009-11-16
512
    
cleanup and update docment
yuki-kimoto authored on 2009-11-19
513
    # Sample with table name
packaging one directory
yuki-kimoto authored on 2009-11-16
514
    ($sql, @bind_values) = $sql_tmpl->create_sql(
515
            "select * from table where {= table.title} && {like table.author}",
516
            {table => {title => 'Perl', author => '%Taro%'}}
517
        )
518
    
cleanup and update docment
yuki-kimoto authored on 2009-11-19
519
    # Expanded
520
    $query->sql : "select * from table where table.title = ? && table.title like ?;"
521
    $query->key_infos :[ [['table.title'],['table', 'title']],
522
                         [['table.author'],['table', 'author']] ]
packaging one directory
yuki-kimoto authored on 2009-11-16
523

            
cleanup and update docment
yuki-kimoto authored on 2009-11-19
524
This method create query using by L<DBIx::Custom>.
525
query has two infomation
packaging one directory
yuki-kimoto authored on 2009-11-16
526

            
cleanup and update docment
yuki-kimoto authored on 2009-11-19
527
    1. sql       : SQL
528
    2. key_infos : Parameter access key information
packaging one directory
yuki-kimoto authored on 2009-11-16
529

            
530
=head2 add_tag_processor
531

            
532
Add tag processor
cleanup and update docment
yuki-kimoto authored on 2009-11-19
533
    
version 0.0901
yuki-kimoto authored on 2009-12-17
534
    $sql_tmpl = $sql_tmpl->add_tag_processor($tag_processor);
535

            
536
The following is add_tag_processor sample
537

            
packaging one directory
yuki-kimoto authored on 2009-11-16
538
    $sql_tmpl->add_tag_processor(
539
        '?' => sub {
540
            my ($tag_name, $tag_args) = @_;
541
            
542
            my $key1 = $tag_args->[0];
543
            my $key2 = $tag_args->[1];
544
            
545
            my $key_infos = [];
546
            
547
            # Expand tag and create key informations
548
            
549
            # Return expand tags and key informations
550
            return ($expand, $key_infos);
551
        }
552
    );
553

            
554
Tag processor recieve 2 argument
555

            
556
    1. Tag name            (?, =, <>, or etc)
557
    2. Tag arguments       (arg1 and arg2 in {tag_name arg1 arg2})
558

            
559
Tag processor return 2 value
560

            
561
    1. Expanded Tag (For exsample, '{= title}' is expanded to 'title = ?')
562
    2. Key infomations
563
    
564
You must be return expanded tag and key infomations.
565

            
566
Key information is a little complex. so I will explan this in future.
567

            
568
If you want to know more, Please see DBIx::Custom::SQL::Template source code.
569

            
570
=head2 clone
571

            
cleanup and update docment
yuki-kimoto authored on 2009-11-19
572
Clone DBIx::Custom::SQL::Template object
573

            
version 0.0901
yuki-kimoto authored on 2009-12-17
574
    $clone = $sql_tmpl->clone;
packaging one directory
yuki-kimoto authored on 2009-11-16
575
    
576
=head1 Available Tags
577
    
cleanup and update docment
yuki-kimoto authored on 2009-11-19
578
Available Tags
579

            
packaging one directory
yuki-kimoto authored on 2009-11-16
580
    [tag]            [expand]
581
    {? name}         ?
582
    {= name}         name = ?
583
    {<> name}        name <> ?
584
    
585
    {< name}         name < ?
586
    {> name}         name > ?
587
    {>= name}        name >= ?
588
    {<= name}        name <= ?
589
    
590
    {like name}      name like ?
591
    {in name}        name in [?, ?, ..]
592
    
cleanup and update docment
yuki-kimoto authored on 2009-11-19
593
    {insert}         (key1, key2, key3) values (?, ?, ?)
594
    {update}         set key1 = ?, key2 = ?, key3 = ?
packaging one directory
yuki-kimoto authored on 2009-11-16
595
    
version 0.0901
yuki-kimoto authored on 2009-12-17
596

            
597
The following is insert SQL sample
598

            
packaging one directory
yuki-kimoto authored on 2009-11-16
599
    $query = $sql_tmpl->create_sql(
600
        "insert into table {insert key1 key2}"
601
    );
version 0.0901
yuki-kimoto authored on 2009-12-17
602
    
cleanup and update docment
yuki-kimoto authored on 2009-11-19
603
    # Expanded
604
    $query->sql : "insert into table (key1, key2) values (?, ?)"
version 0.0901
yuki-kimoto authored on 2009-12-17
605

            
606
The following is update SQL sample
packaging one directory
yuki-kimoto authored on 2009-11-16
607
    
608
    $query = $sql_tmpl->create_sql(
609
        "update table {update key1 key2} where {= key3}"
610
    );
611
    
cleanup and update docment
yuki-kimoto authored on 2009-11-19
612
    # Expanded
613
    $query->sql : "update table set key1 = ?, key2 = ? where key3 = ?;"
packaging one directory
yuki-kimoto authored on 2009-11-16
614
    
615
=cut