IronQuery
A SQL-first query builder for C++
Loading...
Searching...
No Matches
table.hpp
1#pragma once
2
3#include <iron_query/virtual_table.hpp>
4#include <string>
5
6namespace iron_query {
7
10class [[nodiscard]] Table /* not final! */ : public VirtualTable {
11public:
15 static Table FromRaw(std::string name);
16
17 std::string ToString() const override;
18
20 std::string ToStringBracketed() const override;
21
24 std::string ToStringAsFromItem() const override;
25
26protected:
29 Table(std::string name);
30
31private:
32 std::string name_;
33};
34
35} // namespace iron_query
Table with name.
Definition table.hpp:10
std::string ToString() const override
Renders this table value as single-line SQL text. See also ToStringFormatted for a multi-line,...
static Table FromRaw(std::string name)
Wraps a trusted, developer-written table name/reference. Never pass untrusted/dynamic data here — use...
std::string ToStringAsFromItem() const override
Returns the name as-is; this also covers the aliased subqueries and joins that VirtualTable::As turns...
Table(std::string name)
Stores a pre-validated table name; only reachable via FromRaw or a subclass.
std::string ToStringBracketed() const override
Returns the name as-is: a bare table name never needs brackets.
Any table value, including physical table, table result, materialized view, etc.
Definition virtual_table.hpp:14