NAME

Fey::Role::SetOperation - A role for things that are a set operation

VERSION

version 0.37

SYNOPSIS

  use Moose;

  with 'Fey::Role::SetOperation' => { keyword => $keyword };

DESCRIPTION

Classes which do this role represent a query which can include multiple SELECT queries or set operations.

PARAMETERS

keyword

The SQL keyword for this set operation (i.e. UNION, INTERSECT, EXCEPT).

METHODS

This role provides the following methods, where $keyword is the keyword parameter, above:

$query->$keyword()

  $union->union($select1, $select2, $select3);

  $union->union($select, $except->except($select2, $select3));

Adds SELECT queries or set operations to the list of queries that this set operation includes.

A set operation must include at least two queries, so the first time this is called, at least two arguments must be provided; subsequent calls do not suffer this constraint.

$query->all()

Sets whether or not ALL is included in the SQL for this set operation (e.g. UNION ALL).

$query->is_all()

Returns true if $query->all() has previously been called.

$query->keyword_clause()

Returns the SQL keyword and possible ALL for this set operation.

$query->${keyword}_clause()

  print $query->union_clause();

Returns each of the selects for this set operation, joined by the keyword_clause.

ROLES

This class includes Fey::Role::SQL::HasOrderByClause, Fey::Role::SQL::HasLimitClause, and Fey::Role::SQL::HasAliasName.

BUGS

See Fey for details on how to report bugs.

AUTHOR

Dave Rolsky <autarch@urth.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2010 by Dave Rolsky.

This is free software, licensed under:

  The Artistic License 2.0