IronQuery
A SQL-first query builder for C++
Loading...
Searching...
No Matches
delete_from.hpp
1#pragma once
2
3#include <initializer_list>
4#include <iron_query/condition.hpp>
5#include <iron_query/select_item.hpp>
6#include <iron_query/table.hpp>
7#include <iron_query/virtual_table.hpp>
8#include <string>
9
10namespace iron_query {
11
15class [[nodiscard]] DeleteFrom final : public VirtualTable {
16public:
18 DeleteFrom(const Table &tbl);
19
26
30
34
37 DeleteFrom Returning(std::initializer_list<SelectItem> items) &&;
38
40 std::string ToString() const override;
41
42private:
43 std::string from_;
44 std::string using_;
45 std::string where_;
46 std::string returning_;
47};
48
49} // namespace iron_query
A boolean-valued SQL predicate, e.g. the result of a comparison, LIKE/IN/BETWEEN/IS [NOT] NULL,...
Definition condition.hpp:25
Transitional representation for DELETE FROM query.
Definition delete_from.hpp:15
DeleteFrom Returning(std::initializer_list< SelectItem > items) &&
Sets the RETURNING clause to a comma-separated list of entries.
DeleteFrom Where(Condition exp) &&
Sets the WHERE clause.
DeleteFrom Returning(SelectItem item) &&
Sets the RETURNING clause to a single entry.
DeleteFrom(const Table &tbl)
Starts a DELETE FROM tbl query.
std::string ToString() const override
DeleteFrom Using(const VirtualTable &tbl) &&
Sets the USING clause, so WHERE expressions may reference columns of tbl. tbl may be a table,...
A single entry of a SELECT list: an expression, optionally renamed with Expr::As. Kept distinct from ...
Definition select_item.hpp:15
Table with name.
Definition table.hpp:10
Any table value, including physical table, table result, materialized view, etc.
Definition virtual_table.hpp:14