IronQuery
A SQL-first query builder for C++
Loading...
Searching...
No Matches
Public Member Functions | List of all members
iron_query::SetOp Class Referencefinal

Transitional representation for UNION/UNION ALL/INTERSECT/EXCEPT. More...

#include <set_op.hpp>

Inheritance diagram for iron_query::SetOp:
Inheritance graph
[legend]
Collaboration diagram for iron_query::SetOp:
Collaboration graph
[legend]

Public Member Functions

 SetOp (const VirtualTable &a, const VirtualTable &b, const SetOpKind &kind)
 Builds a kind b.
 
std::string ToString () const override
 Renders this table value as single-line SQL text. See also ToStringFormatted for a multi-line, indented rendering.
 
- Public Member Functions inherited from iron_query::VirtualTable
virtual std::string ToStringFormatted () const
 Renders this table value as multi-line, indented SQL text for readability (e.g. logging/debugging a generated query). Defaults to ToString; overridden by SelectExpr to lay out each clause on its own line.
 
virtual std::string ToStringBracketed () const
 Renders this table value as SQL text, parenthesized so it can be safely embedded as a subquery. Overridden by Table to skip bracketing, since a bare table name never needs it.
 
virtual std::string ToStringAsFromItem () const
 Renders this table value as a FROM item. Distinct from ToStringBracketed because PostgreSQL's table_ref grammar accepts a bare join but parenthesizes one only when an alias follows.
 
Table As (std::string_view name) const
 Aliases this table value as this AS name, usable as a FROM source. name must be a valid (optionally dotted) SQL identifier.
 
 operator Expr () const &&
 Converts this table value into a subquery expression, e.g. for use as a scalar subquery. Only available on rvalues.
 

Detailed Description

Transitional representation for UNION/UNION ALL/INTERSECT/EXCEPT.

See also
https://www.postgresql.org/docs/current/sql-select.html

Constructor & Destructor Documentation

◆ SetOp()

iron_query::SetOp::SetOp ( const VirtualTable a,
const VirtualTable b,
const SetOpKind kind 
)

Builds a kind b.

Note
Does not check that a and b produce the same number of columns or compatible column types.

Member Function Documentation

◆ ToString()

std::string iron_query::SetOp::ToString ( ) const
overridevirtual

Renders this table value as single-line SQL text. See also ToStringFormatted for a multi-line, indented rendering.

Implements iron_query::VirtualTable.


The documentation for this class was generated from the following file: