++ed by:
STAUGAARD AZJADFTRE FUKAI XIAOCANG

4 PAUSE users
7 non-PAUSE users.

Yuki Kimoto

NAME

DBIx::Custom::QueryBuilder::TagProcessors - Tag processors

SYNOPSYS

    my $expanded = expand_equal_tag($source);
    my $expanded = expand_greater_than_equal_tag($source);
    my $expanded = expand_greater_than_tag($source);
    my $expanded = expand_like_tag($source);
    my $expanded = expand_lower_than_equal_tag($source);
    my $expanded = expand_lower_than_tag($source);
    my $expanded = expand_in_tag($source);
    my $expanded = expand_insert_param_tag($source);
    my $expanded = expand_not_equal_tag($source);
    my $expanded = expand_placeholder_tag($source);
    my $expanded = expand_update_param_tag($source);

TAG PROCESSORS

Tag processor is function, which receive arguments and return a part of SQL statment and column names. The part of SQL statment contains placeholders. the count of placeholders must be same as the count of column names.

    sub processor_name {
        my @args = @_;
        
        # Part of statment, which constains placeholders
        my $s;
        
        # Column names
        my $columns = [];
        
        # Do something
        # ...
        
        return [$s, $columns];
    }

expand_equal_tag

    ('NAME')  ->  ['NAME = ?', ['NAME']]

expand_greater_than_equal_tag

    ('NAME')  ->  ['NAME >= ?', ['NAME']]

expand_greater_than_tag

    ('NAME')  ->  ['NAME > ?', ['NAME']]

expand_like_tag

    ('NAME')  ->  ['NAME like ?', ['NAME']]

expand_lower_than_equal_tag

    ('NAME')  ->  ['NAME <= ?', ['NAME']]

expand_lower_than_tag

    ('NAME')  ->  ['NAME < ?', ['NAME']]

expand_in_tag

    ('NAME', 3)  -> ['NAME in (?, ?, ?)', ['NAME', 'NAME', 'NAME']]

expand_insert_param_tag

    ('NAME1', 'NAME2')
      ->  ['(NAME1, NAME2) values (?, ?, ?)', ['NAME1', 'NAME2']]

expand_not_equal_tag

    ('NAME')  ->  ['NAME <> ?', ['NAME']]

expand_placeholder_tag

    ('NAME')  ->  ['?', ['NAME']]

expand_update_param_tag

    ('NAME1', 'NAME2')
      ->  ['set NAME1 = ?, NAME2 = ?', ['NAME1', 'NAME2']]