![]() |
mutable
A Database System for Research and Fast Prototyping
|
#include "IR/QueryGraph.hpp"
#include "IR/QueryGraph2SQL.hpp"
#include "parse/ASTDumper.hpp"
#include <mutable/catalog/Catalog.hpp>
#include <mutable/IR/CNF.hpp>
#include <mutable/parse/AST.hpp>
#include <mutable/util/macro.hpp>
Go to the source code of this file.
Data Structures | |
struct | GetNestedQueries |
Helper structure to extract the QueryExpr s in an expression. More... | |
Macros | |
#define | q(X) '"' << X << '"' |
#define | id(X) q(std::hex << &X << std::dec) |
Functions | |
std::vector< std::reference_wrapper< const ast::FnApplicationExpr > > | get_aggregates (const ast::SelectStmt &stmt) |
Given a SelectStmt stmt , extract the aggregates to compute while grouping. | |
bool | is_composable_of (const ast::Expr &expr, const std::vector< std::reference_wrapper< const ast::Expr > > components) |
Computes whether the bound parts of expr are composable of elements in components . | |
bool | equal (const ast::Designator &one, const ast::Designator &two) |
Returns true iff both designators has the same textual representation. | |
void | emplace_back_unique (std::vector< std::pair< const ast::Expr *, PooledOptionalString > > &pairs, const std::pair< const ast::Designator *, PooledOptionalString > &pair) |
Like std::vector::emplace_back() but adds only iff pair is not already contained in pairs . | |
void | emplace_back_unique (std::vector< std::pair< const ast::Expr *, PooledOptionalString > > &pairs, const std::pair< const ast::Expr *, PooledOptionalString > &pair) |
Like std::vector::emplace_back() but adds only iff pair is not already contained in pairs . | |
void | emplace_back (std::vector< const ast::Expr * > &exprs, const ast::Designator *des) |
Like std::vector::emplace_back() but adds only iff des is not already contained in exprs . | |
void | emplace_back_unique (std::vector< const ast::Expr * > &exprs, const ast::Expr *expr) |
Like std::vector::emplace_back() but adds only iff expr is not already contained in exprs . | |
void | emplace_back_unique (std::vector< DataSource * > &sources, DataSource *src) |
Like std::vector::emplace_back() but adds only iff src is not already contained in sources . | |
void | insert (std::vector< const ast::Expr * > &exprs, const std::vector< const ast::Designator * > &insertions) |
Like std::vector::insert() but adds only those elements of insertions which are not already contained in exprs . | |
void | insert (std::vector< const ast::Expr * > &exprs, const std::vector< const ast::Expr * > &insertions) |
Like std::vector::insert() but adds only those elements of insertions which are not already contained in exprs . | |
auto | get_primary_key (DataSource *source) |
Helper structure to compute and provide primary keys. | |
#define q | ( | X | ) | '"' << X << '"' |
void emplace_back | ( | std::vector< const ast::Expr * > & | exprs, |
const ast::Designator * | des | ||
) |
Like std::vector::emplace_back()
but adds only iff des
is not already contained in exprs
.
Definition at line 580 of file QueryGraph.cpp.
References m::and, and m::equal().
Referenced by emplace_back_unique(), and insert().
void emplace_back_unique | ( | std::vector< const ast::Expr * > & | exprs, |
const ast::Expr * | expr | ||
) |
Like std::vector::emplace_back()
but adds only iff expr
is not already contained in exprs
.
Definition at line 590 of file QueryGraph.cpp.
References m::contains(), and emplace_back().
void emplace_back_unique | ( | std::vector< DataSource * > & | sources, |
DataSource * | src | ||
) |
Like std::vector::emplace_back()
but adds only iff src
is not already contained in sources
.
Definition at line 599 of file QueryGraph.cpp.
References m::DataSource::name().
void emplace_back_unique | ( | std::vector< std::pair< const ast::Expr *, PooledOptionalString > > & | pairs, |
const std::pair< const ast::Designator *, PooledOptionalString > & | pair | ||
) |
Like std::vector::emplace_back()
but adds only iff pair
is not already contained in pairs
.
Definition at line 559 of file QueryGraph.cpp.
References m::and, and m::equal().
Referenced by emplace_back_unique().
void emplace_back_unique | ( | std::vector< std::pair< const ast::Expr *, PooledOptionalString > > & | pairs, |
const std::pair< const ast::Expr *, PooledOptionalString > & | pair | ||
) |
Like std::vector::emplace_back()
but adds only iff pair
is not already contained in pairs
.
Definition at line 570 of file QueryGraph.cpp.
References m::contains(), and emplace_back_unique().
bool equal | ( | const ast::Designator & | one, |
const ast::Designator & | two | ||
) |
Returns true
iff both designators has the same textual representation.
Definition at line 554 of file QueryGraph.cpp.
References m::streq(), and m::to_string().
std::vector< std::reference_wrapper< const ast::FnApplicationExpr > > get_aggregates | ( | const ast::SelectStmt & | stmt | ) |
Given a SelectStmt
stmt
, extract the aggregates to compute while grouping.
Definition at line 348 of file QueryGraph.cpp.
References m::ast::SelectStmt::having, M_insist, m::ast::SelectStmt::order_by, m::ast::SelectStmt::select, m::to_string(), and m::visit().
auto get_primary_key | ( | DataSource * | source | ) |
Helper structure to compute and provide primary keys.
Compute and provide all primary keys of source
.
Definition at line 714 of file QueryGraph.cpp.
void insert | ( | std::vector< const ast::Expr * > & | exprs, |
const std::vector< const ast::Designator * > & | insertions | ||
) |
Like std::vector::insert()
but adds only those elements of insertions
which are not already contained in exprs
.
Definition at line 610 of file QueryGraph.cpp.
References emplace_back().
Referenced by m::wasm::ChainedHashTable< IsGlobal >::insert_key(), and m::wasm::OpenAddressingHashTable< IsGlobal, ValueInPlace >::insert_key().
void insert | ( | std::vector< const ast::Expr * > & | exprs, |
const std::vector< const ast::Expr * > & | insertions | ||
) |
Like std::vector::insert()
but adds only those elements of insertions
which are not already contained in exprs
.
Definition at line 617 of file QueryGraph.cpp.
References m::contains(), and emplace_back().
bool is_composable_of | ( | const ast::Expr & | expr, |
const std::vector< std::reference_wrapper< const ast::Expr > > | components | ||
) |
Computes whether the bound parts of expr
are composable of elements in components
.
Definition at line 383 of file QueryGraph.cpp.
References m::and, is_composable_of(), and m::visit().
Referenced by is_composable_of(), and m::GraphBuilder::process_selection().