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

Table with name. More...

#include <table.hpp>

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

Public Member Functions

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 ToStringBracketed () const override
 Returns the name as-is: a bare table name never needs brackets.
 
std::string ToStringAsFromItem () const override
 Returns the name as-is; this also covers the aliased subqueries and joins that VirtualTable::As turns into a Table.
 
- 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.
 
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.
 

Static Public Member Functions

static Table FromRaw (std::string name)
 Wraps a trusted, developer-written table name/reference. Never pass untrusted/dynamic data here — use Expr::Ident to escape a dynamically-sourced name and pass it as an alias/expression instead.
 

Protected Member Functions

 Table (std::string name)
 Stores a pre-validated table name; only reachable via FromRaw or a subclass.
 

Detailed Description

Table with name.

Member Function Documentation

◆ ToString()

std::string iron_query::Table::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.

◆ ToStringAsFromItem()

std::string iron_query::Table::ToStringAsFromItem ( ) const
overridevirtual

Returns the name as-is; this also covers the aliased subqueries and joins that VirtualTable::As turns into a Table.

Reimplemented from iron_query::VirtualTable.

◆ ToStringBracketed()

std::string iron_query::Table::ToStringBracketed ( ) const
overridevirtual

Returns the name as-is: a bare table name never needs brackets.

Reimplemented from iron_query::VirtualTable.


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