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::In - Represent the SQL IN operator

SYNOPSIS

This class can build the following SQL

        expr IN (anything [, ...])

Basically:

        my $in = SQL::Builder::In->new();

        $in->lhs('col1');
        $in->rhs->list_push(1..5);

        # col1 IN (1, 2, 3, 4, 5)
        print $in->sql

and of course, you can do it all through the inherited constructor:

        my $in = SQL::Builder::In->new(
                lhs => 'col1',
                'rhs->list_push' => [1..5]
        );

DESCRIPTION

This is a SQL::Builder::BinaryOp(3) subclass. Chances are the most useful methods useful in this class are rhs(), lhs(), and sql()

METHODS

init()

This calls SQL::Builder::BinaryOp::init() and provides rhs() with a SQL::Builder::List(3) object as well as setting op() to 'IN'

rhs

This method is not overwritten in this class, but init() sets its value to a List object. See SQL::Builder::List(3) for its documentation

SEE ALSO

SQL::Builder::List(3) SQL::Builder::BinaryOp(3) SQL::Builder::Base(3) SQL::Builder(3)