The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

DBIx::Custom::SQLBuilder::TagProcessors - Tag processors

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']]