|
IronQuery
A SQL-first query builder for C++
|
Finalized WITH ... query, usable anywhere a VirtualTable is (subquery, FROM source, etc.) More...
#include <with.hpp>


Public Member Functions | |
| WithQuery (std::string ctes, std::string main, std::string ctes_formatted, std::string main_formatted) | |
Wraps already-rendered ctes (name AS (query), ...) and main query text, plus their multi-line formatted counterparts; only reachable via WithBuilder::Main. | |
| std::string | ToString () const override |
| Renders this table value as single-line SQL text. See also ToStringFormatted for a multi-line, indented rendering. | |
| std::string | ToStringFormatted () const override |
| Renders the WITH clause with each CTE in its own indented block, followed by the formatted main query, e.g.: | |
Public Member Functions inherited from iron_query::VirtualTable | |
| 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. | |
Finalized WITH ... query, usable anywhere a VirtualTable is (subquery, FROM source, etc.)
|
overridevirtual |
Renders this table value as single-line SQL text. See also ToStringFormatted for a multi-line, indented rendering.
Implements iron_query::VirtualTable.
|
overridevirtual |
Renders the WITH clause with each CTE in its own indented block, followed by the formatted main query, e.g.:
Reimplemented from iron_query::VirtualTable.