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 sql_result_H
10#define sql_result_H
11
12#include "mal_client.h"
13#include "stream.h"
14#include "sql.h"
15#include "sql_mvc.h"
16#include "sql_catalog.h"
17#include "sql_qc.h"
18#include "sql_parser.h" /* sql_error */
19
20extern int mvc_export_affrows(backend *b, stream *s, lng val, str w, oid query_id, lng starttime, lng maloptimizer);
21extern int mvc_export_operation(backend *b, stream *s, str w, lng starttime, lng maloptimizer);
22extern int mvc_export_result(backend *b, stream *s, int res_id, bool header, lng starttime, lng maloptimizer);
23extern int mvc_export_head(backend *b, stream *s, int res_id, int only_header, int compute_lengths, lng starttime, lng maloptimizer);
24extern int mvc_export_chunk(backend *b, stream *s, int res_id, BUN offset, BUN nr);
25
26extern int mvc_export_prepare(mvc *c, stream *s, cq *q, str w);
27
28extern str mvc_import_table(Client cntxt, BAT ***bats, mvc *c, bstream *s, sql_table *t, const char *sep, const char *rsep, const char *ssep, const char *ns, lng nr, lng offset, int locked, int best, bool from_stdin);
29extern int mvc_result_table(mvc *m, oid query_id, int nr_cols, sql_query_t type, BAT *order);
30
31extern int mvc_result_column(mvc *m, char *tn, char *name, char *typename, int digits, int scale, BAT *b);
32extern int mvc_result_value(mvc *m, const char *tn, const char *name, const char *typename, int digits, int scale, ptr *p, int mtype);
33
34extern int convert2str(mvc *m, sql_class eclass, int d, int sc, int has_tz, ptr p, int mtype, char **buf, int len);
35
36#endif /* sql_result_H */
37