NAME
DB::Object::Expression - Expression Object
SYNOPSIS
my $op = $dbh->ANY( 1, 2, 3 );
# will produce:
ANY ( 1, 2, 3 )
"'something'" == $dbh->ALL( qw( some other words ) );
"'something'" == $dbh->ANY( qw( some other words ) );
"'something'" == $dbh->IN( qw( some other words ) );
# 'something' ANY ( some, other, words );
"something" != $dbh->ANY( qw( some other words ) );
# 'something' NOT ANY ( some, other, words );
DESCRIPTION
This is a class to represent an expression and is fairly simple, and designed to be recognised and processed accordingly when building SQL statements, such as in WHERE clauses.
DB::Object::Expression are instantiated when operators like ALL, ANY or IN are subject to overloading. such as demonstrated in the SYNOPSIS
METHODS
new
Takes a list of values that are saved in the newly created object returned.
as_string
Returns a space separated list of values embedded in the object.
For example:
"'something'" == $dbh->ANY( qw( some other words ) );
# 'something' ANY ( some, other, words );
components
my @values = $expr->components;
my $values = $expr->components;
In list context, returns an array of those values passed to "new" and in scalar context, it returns those value as array reference.
OVERLOADING
Objects for this class calls "as_string" when they need to be stringified.
SEE ALSO
DB::Object::ALL, DB::Object::ANY, DB::Object::IN
AUTHOR
Jacques Deguest <jack@deguest.jp>
COPYRIGHT & LICENSE
Copyright (c) 2023-2026 DEGUEST Pte. Ltd.
You can use, copy, modify and redistribute this package and associated files under the same terms as Perl itself.