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 _SQL2MAL_H
10#define _SQL2MAL_H
11
12#include "sql.h"
13#include "mal_backend.h"
14#include "sql_atom.h"
15#include "sql_statement.h"
16#include "sql_env.h"
17#include "sql_mvc.h"
18#include "mal_function.h"
19
20sql5_export Symbol backend_dumpproc(backend *be, Client c, cq *q, sql_rel *r);
21sql5_export int backend_callinline(backend *be, Client c);
22sql5_export int backend_dumpstmt(backend *be, MalBlkPtr mb, sql_rel *r, int top, int addend, const char *query);
23sql5_export void backend_call(backend *be, Client c, cq *q);
24sql5_export int monet5_resolve_function(ptr M, sql_func *f);
25sql5_export int backend_create_func(backend *be, sql_func *f, list *restypes, list *ops);
26extern int backend_create_subfunc(backend *be, sql_subfunc *f, list *ops);
27extern int backend_create_subaggr(backend *be, sql_subaggr *f);
28
29sql5_export int monet5_create_relational_function(mvc *m, const char *mod, const char *name, sql_rel *rel, stmt *call, list *rel_ops, int inline_func);
30
31extern void rel_print(mvc *sql, sql_rel *rel, int depth);
32extern void _rel_print(mvc *sql, sql_rel *rel);
33
34extern int constantAtom(backend *be, MalBlkPtr mb, atom *a);
35extern InstrPtr table_func_create_result(MalBlkPtr mb, InstrPtr q, sql_func *f, list *restypes);
36extern InstrPtr relational_func_create_result(mvc *sql, MalBlkPtr mb, InstrPtr q, sql_rel *f);
37
38#endif /* _SQL2MAL_H */
39