24#ifndef __M_SQL_REPORT_H__
25#define __M_SQL_REPORT_H__
29#include <mstdlib/base/m_defs.h>
30#include <mstdlib/base/m_types.h>
31#include <mstdlib/sql/m_sql.h>
32#include <mstdlib/sql/m_sql_stmt.h>
33#include <mstdlib/formats/m_json.h>
74struct M_sql_report_state;
118M_API M_bool
M_sql_report_set_delims(
M_sql_report_t *report,
const unsigned char *field_delim,
size_t field_delim_size,
const unsigned char *row_delim,
size_t row_delim_size,
const unsigned char *field_encaps,
size_t field_encaps_size,
const unsigned char *field_escape,
size_t field_escape_size);
237struct M_sql_report_filter;
struct M_buf M_buf_t
Definition: m_buf.h:77
struct M_json_node M_json_node_t
Definition: m_json.h:95
M_sql_error_t
Definition: m_sql.h:190
struct M_sql_report_state M_sql_report_state_t
Definition: m_sql_report.h:76
M_sql_report_filter_t * M_sql_report_filter_create(M_sql_report_filter_type_t type)
M_sql_report_flags_t
Definition: m_sql_report.h:47
M_sql_report_cberror_t M_sql_report_cell_cb_passthru(M_sql_stmt_t *stmt, void *arg, const char *name, size_t row, ssize_t col, M_buf_t *buf, M_bool *is_null)
M_sql_error_t M_sql_report_process_partial_json(const M_sql_report_t *report, M_sql_stmt_t *stmt, size_t max_rows, void *arg, M_json_node_t *json, M_sql_report_state_t **state, char *error, size_t error_size)
M_sql_report_filter_type_t
Definition: m_sql_report.h:241
M_sql_report_cberror_t M_sql_report_cell_cb_int5dec(M_sql_stmt_t *stmt, void *arg, const char *name, size_t row, ssize_t col, M_buf_t *buf, M_bool *is_null)
M_bool M_sql_report_set_fetch_cb(M_sql_report_t *report, M_sql_report_fetch_cb_t fetch_cb)
struct M_sql_report_filter M_sql_report_filter_t
Definition: m_sql_report.h:239
M_sql_error_t M_sql_report_process_partial(const M_sql_report_t *report, M_sql_stmt_t *stmt, size_t max_rows, void *arg, M_buf_t *buf, M_sql_report_state_t **state, char *error, size_t error_size)
M_sql_report_cberror_t M_sql_report_cell_cb_int5min2dec(M_sql_stmt_t *stmt, void *arg, const char *name, size_t row, ssize_t col, M_buf_t *buf, M_bool *is_null)
void M_sql_report_filter_destroy(M_sql_report_filter_t *filter)
M_bool M_sql_report_add_filter(M_sql_report_t *report, M_sql_report_filter_t *filter)
void M_sql_report_destroy(M_sql_report_t *report)
M_bool M_sql_report_filter_add_rule(M_sql_report_filter_t *filter, const char *column, M_sql_report_filter_rule_t rule, M_bool case_insensitive, const char *data)
M_sql_report_cberror_t M_sql_report_cell_cb_int2dec(M_sql_stmt_t *stmt, void *arg, const char *name, size_t row, ssize_t col, M_buf_t *buf, M_bool *is_null)
M_sql_report_cberror_t(* M_sql_report_cell_cb_t)(M_sql_stmt_t *stmt, void *arg, const char *name, size_t row, ssize_t col, M_buf_t *buf, M_bool *is_null)
Definition: m_sql_report.h:166
M_sql_report_t * M_sql_report_create(M_uint32 flags)
M_bool M_sql_report_set_delims(M_sql_report_t *report, const unsigned char *field_delim, size_t field_delim_size, const unsigned char *row_delim, size_t row_delim_size, const unsigned char *field_encaps, size_t field_encaps_size, const unsigned char *field_escape, size_t field_escape_size)
struct M_sql_report M_sql_report_t
Definition: m_sql_report.h:72
M_sql_report_filter_rule_t
Definition: m_sql_report.h:261
M_bool M_sql_report_add_column(M_sql_report_t *report, const char *name, M_sql_report_cell_cb_t cb, const char *sql_col_name, ssize_t sql_col_idx)
M_bool(* M_sql_report_fetch_cb_t)(M_sql_stmt_t *stmt, void *arg)
Definition: m_sql_report.h:129
void M_sql_report_state_cancel(M_sql_report_state_t *state)
M_sql_report_cberror_t M_sql_report_cell_cb_boolyesno(M_sql_stmt_t *stmt, void *arg, const char *name, size_t row, ssize_t col, M_buf_t *buf, M_bool *is_null)
M_sql_error_t M_sql_report_process(const M_sql_report_t *report, M_sql_stmt_t *stmt, void *arg, char **out, size_t *out_len, char *error, size_t error_size)
M_sql_error_t M_sql_report_process_json(const M_sql_report_t *report, M_sql_stmt_t *stmt, void *arg, M_json_node_t *json, char *error, size_t error_size)
M_bool M_sql_report_hide_column(M_sql_report_t *report, const char *sql_col_name, ssize_t sql_col_idx)
M_sql_report_cberror_t
Definition: m_sql_report.h:63
@ M_SQL_REPORT_FLAG_OMIT_HEADERS
Definition: m_sql_report.h:52
@ M_SQL_REPORT_FLAG_PASSTHRU_UNLISTED
Definition: m_sql_report.h:53
@ M_SQL_REPORT_FLAG_NONE
Definition: m_sql_report.h:48
@ M_SQL_REPORT_FLAG_ALWAYS_ENCAP
Definition: m_sql_report.h:49
@ M_SQL_REPORT_FILTER_TYPE_AND
Definition: m_sql_report.h:243
@ M_SQL_REPORT_FILTER_TYPE_OR
Definition: m_sql_report.h:242
@ M_SQL_REPORT_FILTER_RULE_CONTAINS
Definition: m_sql_report.h:264
@ M_SQL_REPORT_FILTER_RULE_NOT_CONTAINS
Definition: m_sql_report.h:265
@ M_SQL_REPORT_FILTER_RULE_NOT_EMPTY
Definition: m_sql_report.h:271
@ M_SQL_REPORT_FILTER_RULE_BEGINS_WITH
Definition: m_sql_report.h:266
@ M_SQL_REPORT_FILTER_RULE_NOT_BEGINS_WITH
Definition: m_sql_report.h:267
@ M_SQL_REPORT_FILTER_RULE_NOT_MATCHES
Definition: m_sql_report.h:263
@ M_SQL_REPORT_FILTER_RULE_ENDS_WITH
Definition: m_sql_report.h:268
@ M_SQL_REPORT_FILTER_RULE_MATCHES
Definition: m_sql_report.h:262
@ M_SQL_REPORT_FILTER_RULE_EMPTY
Definition: m_sql_report.h:270
@ M_SQL_REPORT_FILTER_RULE_NOT_ENDS_WITH
Definition: m_sql_report.h:269
@ M_SQL_REPORT_SUCCESS
Definition: m_sql_report.h:65
@ M_SQL_REPORT_SKIP_ROW
Definition: m_sql_report.h:66
@ M_SQL_REPORT_ERROR
Definition: m_sql_report.h:64
struct M_sql_stmt M_sql_stmt_t
Definition: m_sql_stmt.h:46