3#include <iron_query/virtual_table.hpp>
18 WithQuery(std::string ctes, std::string main, std::string ctes_formatted,
19 std::string main_formatted);
43 std::string ctes_formatted_;
44 std::string main_formatted_;
69 std::string ctes_formatted_;
70 std::vector<std::string> cte_names_;
Any table value, including physical table, table result, materialized view, etc.
Definition virtual_table.hpp:14
Transitional representation for a WITH clause being built up.
Definition with.hpp:50
friend WithBuilder With(std::string name, const VirtualTable &query)
Handy fabric for WithBuilder. name must be a valid (optionally dotted) SQL identifier.
WithBuilder With(std::string name, const VirtualTable &query) &&
Adds another CTE: , name AS (query). name must be a valid (optionally dotted) SQL identifier not alre...
WithQuery Main(const VirtualTable &query) &&
Finalizes the WITH clause with the main query that follows it.
Finalized WITH ... query, usable anywhere a VirtualTable is (subquery, FROM source,...
Definition with.hpp:13
std::string ToStringFormatted() const override
Renders the WITH clause with each CTE in its own indented block, followed by the formatted main query...
std::string ToString() const override
Renders this table value as single-line SQL text. See also ToStringFormatted for a multi-line,...
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 formatt...
WithBuilder With(std::string name, const VirtualTable &query)
Handy fabric for WithBuilder. name must be a valid (optionally dotted) SQL identifier.