24#ifndef __M_SQL_TABLE_H__
25#define __M_SQL_TABLE_H__
29#include <mstdlib/base/m_defs.h>
30#include <mstdlib/base/m_types.h>
31#include <mstdlib/sql/m_sql.h>
218struct M_sql_tabledata_field;
224struct M_sql_tabledata_txn;
struct M_list_str M_list_str_t
Definition: m_list_str.h:80
struct M_sql_connpool M_sql_connpool_t
Definition: m_sql.h:335
M_sql_error_t
Definition: m_sql.h:190
M_sql_data_type_t
Definition: m_sql.h:256
M_bool M_sql_table_exists(M_sql_connpool_t *pool, const char *name)
struct M_sql_table M_sql_table_t
Definition: m_sql_table.h:49
M_sql_error_t M_sql_table_execute(M_sql_connpool_t *pool, M_sql_table_t *table, char *error, size_t error_size)
void M_sql_table_destroy(M_sql_table_t *table)
M_sql_table_index_flags_t
Definition: m_sql_table.h:66
M_bool M_sql_index_add_col(M_sql_index_t *idx, const char *col_name)
M_sql_table_t * M_sql_table_create(const char *name)
M_sql_index_t * M_sql_table_add_index(M_sql_table_t *table, M_uint32 flags, const char *idx_name)
struct M_sql_index M_sql_index_t
Definition: m_sql_table.h:55
M_bool M_sql_table_add_col(M_sql_table_t *table, M_uint32 flags, const char *col_name, M_sql_data_type_t datatype, size_t max_len, const char *default_value)
M_bool M_sql_table_add_pk_col(M_sql_table_t *table, const char *col_name)
M_bool M_sql_table_add_index_str(M_sql_table_t *table, M_uint32 flags, const char *idx_name, const char *idx_cols_csv)
M_sql_table_col_flags_t
Definition: m_sql_table.h:59
@ M_SQL_INDEX_FLAG_UNIQUE
Definition: m_sql_table.h:68
@ M_SQL_INDEX_FLAG_NONE
Definition: m_sql_table.h:67
@ M_SQL_TABLE_COL_FLAG_NONE
Definition: m_sql_table.h:60
@ M_SQL_TABLE_COL_FLAG_NOTNULL
Definition: m_sql_table.h:61
const char * table_column
Definition: m_sql_table.h:305
const char * field_name
Definition: m_sql_table.h:306
size_t max_column_len
Definition: m_sql_table.h:307
M_sql_tabledata_validate_cb validate_cb
Definition: m_sql_table.h:311
M_sql_tabledata_filtertransform_cb filter_cb
Definition: m_sql_table.h:310
M_sql_data_type_t type
Definition: m_sql_table.h:308
M_sql_tabledata_flags_t flags
Definition: m_sql_table.h:309
void M_sql_tabledata_field_set_binary_dup(M_sql_tabledata_field_t *field, const unsigned char *val, size_t len)
M_bool M_sql_tabledata_field_get_text(M_sql_tabledata_field_t *field, const char **val)
M_bool M_sql_tabledata_filter_int2dec_cb(M_sql_tabledata_txn_t *txn, const char *field_name, M_sql_tabledata_field_t *field, char *error, size_t error_len)
M_sql_error_t(* M_sql_tabledata_validate_cb)(M_sql_trans_t *sqltrans, M_sql_tabledata_txn_t *txn, const char *field_name, char *error, size_t error_len)
Definition: m_sql_table.h:300
void M_sql_tabledata_field_set_text_const(M_sql_tabledata_field_t *field, const char *val)
M_sql_error_t M_sql_tabledata_trans_add(M_sql_trans_t *sqltrans, const char *table_name, const M_sql_tabledata_t *fields, size_t num_fields, M_sql_tabledata_fetch_cb fetch_cb, M_sql_tabledata_notify_cb notify_cb, void *thunk, M_int64 *generated_id, char *error, size_t error_len)
M_bool M_sql_tabledata_field_get_int32(M_sql_tabledata_field_t *field, M_int32 *val)
void M_sql_tabledata_field_set_null(M_sql_tabledata_field_t *field)
void M_sql_tabledata_field_set_binary_const(M_sql_tabledata_field_t *field, const unsigned char *val, size_t len)
void * M_sql_tabledata_txn_get_thunk(M_sql_tabledata_txn_t *txn)
M_int64 M_sql_tabledata_txn_get_generated_id(M_sql_tabledata_txn_t *txn)
M_bool M_sql_tabledata_field_get_int16(M_sql_tabledata_field_t *field, M_int16 *val)
M_bool M_sql_tabledata_txn_is_add(M_sql_tabledata_txn_t *txn)
M_sql_error_t M_sql_tabledata_trans_edit(M_sql_trans_t *sqltrans, const char *table_name, const M_sql_tabledata_t *fields, size_t num_fields, M_sql_tabledata_fetch_cb fetch_cb, M_sql_tabledata_notify_cb notify_cb, void *thunk, char *error, size_t error_len)
M_sql_tabledata_txn_field_select_t
Definition: m_sql_table.h:531
M_sql_tabledata_field_t * M_sql_tabledata_txn_field_get(M_sql_tabledata_txn_t *txn, const char *field_name, M_sql_tabledata_txn_field_select_t fselect)
void M_sql_tabledata_field_set_int32(M_sql_tabledata_field_t *field, M_int32 val)
M_bool M_sql_tabledata_field_is_null(const M_sql_tabledata_field_t *field)
const M_sql_tabledata_t * M_sql_tabledata_txn_fetch_fielddef(M_sql_tabledata_txn_t *txn, const char *field_name)
M_bool M_sql_tabledata_field_get_binary(M_sql_tabledata_field_t *field, const unsigned char **val, size_t *len)
void M_sql_tabledata_field_set_text_own(M_sql_tabledata_field_t *field, char *val)
M_sql_error_t M_sql_tabledata_upsert(M_sql_connpool_t *pool, const char *table_name, const M_sql_tabledata_t *fields, size_t num_fields, M_sql_tabledata_fetch_cb fetch_cb, M_sql_tabledata_notify_cb notify_cb, void *thunk, char *error, size_t error_len)
M_bool M_sql_tabledata_filter_alnum_cb(M_sql_tabledata_txn_t *txn, const char *field_name, M_sql_tabledata_field_t *field, char *error, size_t error_len)
struct M_sql_tabledata_txn M_sql_tabledata_txn_t
Definition: m_sql_table.h:227
M_sql_error_t M_sql_tabledata_trans_upsert(M_sql_trans_t *sqltrans, const char *table_name, const M_sql_tabledata_t *fields, size_t num_fields, M_sql_tabledata_fetch_cb fetch_cb, M_sql_tabledata_notify_cb notify_cb, void *thunk, char *error, size_t error_len)
M_sql_error_t M_sql_tabledata_edit(M_sql_connpool_t *pool, const char *table_name, const M_sql_tabledata_t *fields, size_t num_fields, M_sql_tabledata_fetch_cb fetch_cb, M_sql_tabledata_notify_cb notify_cb, void *thunk, char *error, size_t error_len)
M_bool(* M_sql_tabledata_filtertransform_cb)(M_sql_tabledata_txn_t *txn, const char *field_name, M_sql_tabledata_field_t *field, char *error, size_t error_len)
Definition: m_sql_table.h:261
void M_sql_tabledata_field_set_int64(M_sql_tabledata_field_t *field, M_int64 val)
M_bool M_sql_tabledata_field_get_bool(M_sql_tabledata_field_t *field, M_bool *val)
M_sql_error_t(* M_sql_tabledata_notify_cb)(M_sql_trans_t *sqltrans, M_sql_tabledata_txn_t *txn, char *error, size_t error_len)
Definition: m_sql_table.h:600
void M_sql_tabledata_field_set_bool(M_sql_tabledata_field_t *field, M_bool val)
struct M_sql_tabledata_field M_sql_tabledata_field_t
Definition: m_sql_table.h:221
void M_sql_tabledata_field_set_binary_own(M_sql_tabledata_field_t *field, unsigned char *val, size_t len)
M_bool M_sql_tabledata_txn_field_changed(M_sql_tabledata_txn_t *txn, const char *field_name)
M_bool M_sql_tabledata_filter_int5dec_cb(M_sql_tabledata_txn_t *txn, const char *field_name, M_sql_tabledata_field_t *field, char *error, size_t error_len)
M_sql_tabledata_field_t * M_sql_tabledata_field_create_ext(void)
void M_sql_tabledata_field_set_int16(M_sql_tabledata_field_t *field, M_int16 val)
void M_sql_tabledata_field_destroy_ext(M_sql_tabledata_field_t *field)
M_bool M_sql_tabledata_filter_alnumsp_cb(M_sql_tabledata_txn_t *txn, const char *field_name, M_sql_tabledata_field_t *field, char *error, size_t error_len)
const char * M_sql_tabledata_txn_get_tablename(M_sql_tabledata_txn_t *txn)
M_sql_data_type_t M_sql_tabledata_field_type(const M_sql_tabledata_field_t *field)
M_bool M_sql_tabledata_field_get_int64(M_sql_tabledata_field_t *field, M_int64 *val)
M_sql_error_t M_sql_tabledata_add(M_sql_connpool_t *pool, const char *table_name, const M_sql_tabledata_t *fields, size_t num_fields, M_sql_tabledata_fetch_cb fetch_cb, M_sql_tabledata_notify_cb notify_cb, void *thunk, M_int64 *generated_id, char *error, size_t error_len)
void M_sql_tabledata_field_set_text_dup(M_sql_tabledata_field_t *field, const char *val)
M_bool M_sql_tabledata_field_is_alloc(const M_sql_tabledata_field_t *field)
M_bool M_sql_tabledata_to_table(M_sql_table_t *table, const M_sql_tabledata_t *fields, size_t num_fields)
M_bool M_sql_tabledata_filter_alpha_cb(M_sql_tabledata_txn_t *txn, const char *field_name, M_sql_tabledata_field_t *field, char *error, size_t error_len)
M_bool M_sql_tabledata_filter_graph_cb(M_sql_tabledata_txn_t *txn, const char *field_name, M_sql_tabledata_field_t *field, char *error, size_t error_len)
M_bool(* M_sql_tabledata_fetch_cb)(M_sql_tabledata_field_t *out, const char *field_name, M_bool is_add, void *thunk)
Definition: m_sql_table.h:586
M_bool M_sql_tabledata_txn_field_changed_ci(M_sql_tabledata_txn_t *txn, const char *field_name)
M_sql_tabledata_flags_t
Definition: m_sql_table.h:230
M_sql_tabledata_t * M_sql_tabledata_append_virtual_list(const M_sql_tabledata_t *fields, size_t *num_fields, const char *table_column, const M_list_str_t *field_names, size_t max_len, M_sql_tabledata_flags_t flags)
@ M_SQL_TABLEDATA_TXN_FIELD_PRIOR
Definition: m_sql_table.h:534
@ M_SQL_TABLEDATA_TXN_FIELD_MERGED
Definition: m_sql_table.h:532
@ M_SQL_TABLEDATA_TXN_FIELD_MERGED_NODUPLICATE
Definition: m_sql_table.h:533
@ M_SQL_TABLEDATA_TXN_FIELD_CURRENT_READONLY
Definition: m_sql_table.h:535
@ M_SQL_TABLEDATA_TXN_FIELD_CURRENT
Definition: m_sql_table.h:536
@ M_SQL_TABLEDATA_FLAG_EDITABLE
Definition: m_sql_table.h:233
@ M_SQL_TABLEDATA_FLAG_NONE
Definition: m_sql_table.h:231
@ M_SQL_TABLEDATA_FLAG_ID
Definition: m_sql_table.h:235
@ M_SQL_TABLEDATA_FLAG_ID_GENERATE
Definition: m_sql_table.h:237
@ M_SQL_TABLEDATA_FLAG_NOTNULL
Definition: m_sql_table.h:234
@ M_SQL_TABLEDATA_FLAG_ID_REQUIRED
Definition: m_sql_table.h:238
@ M_SQL_TABLEDATA_FLAG_TIMESTAMP
Definition: m_sql_table.h:240
@ M_SQL_TABLEDATA_FLAG_VIRTUAL
Definition: m_sql_table.h:232
@ M_SQL_TABLEDATA_FLAG_ALLOW_NONPRINT_SEP
Definition: m_sql_table.h:241
Definition: m_sql_table.h:304
struct M_sql_trans M_sql_trans_t
Definition: m_sql_trans.h:50