The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

SQL::Builder::UnaryOp - Represent a SQL unary operator/expression

SYNOPSIS

        # generate a new unary op object with a subclass
        my $op = SQL::Builder::...

        $op->op("!");

        $op->oper(50);
        
        # see the child class for what this does
        print $op->sql;
        
        # turn on parenthesis
        $op->parens(1);

DESCRIPTION

This is just a skeleton class, intended to be subclassed. See SQL::Builder::PrefixOp(3) and SQL::Builder::PostfixOp(3) for examples.

METHODS

op([$op])

Get/set the operator. When called with arguments, the operator is set and current object is returned; otherwise, the current operator is returned.

oper([$operand])

Get/set the operand to be used in the unary operator expression. If called with an argument, the operand is set and current obejct is returned; otherwise the current value is returned

sql()

This doesn't do anything except throw an error because it should always be implemented in subclasses

children()

Return a SQL::Builder::Iterator object to iterate over the values of op() and oper()

SEE ALSO

SQL::Builder(3) SQL::Builder::Base(3) SQL::Builder::PrefixOp(3) SQL::Builder::PostfixOp(3)