1/*
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 *
6 * Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
7 */
8
9#ifndef _REL_SELECT_H_
10#define _REL_SELECT_H_
11
12#include "rel_semantic.h"
13#include "sql_semantic.h"
14#include "sql_query.h"
15
16extern sql_rel *rel_selects(sql_query *query, symbol *sym);
17extern sql_rel *schema_selects(sql_query *query, sql_schema *s, symbol *sym);
18extern sql_rel * rel_subquery(sql_query *query, sql_rel *rel, symbol *sq, exp_kind ek);
19extern sql_rel * rel_logical_exp(sql_query *query, sql_rel *rel, symbol *sc, int f);
20extern sql_exp * rel_logical_value_exp(sql_query *query, sql_rel **rel, symbol *sc, int f);
21
22extern sql_exp *rel_column_exp(sql_query *query, sql_rel **rel, symbol *column_e, int f);
23extern sql_exp * rel_value_exp(sql_query *query, sql_rel **rel, symbol *se, int f, exp_kind ek);
24extern sql_exp * rel_value_exp2(sql_query *query, sql_rel **rel, symbol *se, int f, exp_kind ek, int *is_last);
25
26/* TODO rename to exp_check_type + move to rel_exp.c */
27extern sql_exp *rel_check_type(mvc *sql, sql_subtype *t, sql_rel *rel, sql_exp *exp, check_type tpe);
28
29extern sql_exp *rel_unop_(mvc *sql, sql_rel *rel, sql_exp *e, sql_schema *s, char *fname, int card);
30extern sql_exp *rel_binop_(mvc *sql, sql_rel *rel, sql_exp *l, sql_exp *r, sql_schema *s, char *fname, int card);
31extern sql_exp *rel_nop_(mvc *sql, sql_rel *rel, sql_exp *l, sql_exp *r, sql_exp *r2, sql_exp *r3, sql_schema *s,
32 char *fname, int card);
33extern sql_rel *rel_with_query(sql_query *query, symbol *q);
34extern sql_rel *table_ref(sql_query *query, sql_rel *rel, symbol *tableref, int lateral);
35
36extern sql_rel *rel_loader_function(sql_query* query, symbol* s, list *fexps, sql_subfunc **loader_function);
37
38#endif /*_REL_SELECT_H_*/
39