MySQL Connector/C++ 9.1.0
MySQL connector library for C and C++ applications
|
Functions | |
mysqlx_result_t * | mysqlx_table_select (mysqlx_table_t *table, const char *criteria) |
Execute a table SELECT statement with a WHERE clause. More... | |
mysqlx_result_t * | mysqlx_table_select_limit (mysqlx_table_t *table, const char *criteria, uint64_t row_count, uint64_t offset,...) |
Execute a table SELECT statement with a WHERE, ORDER BY and LIMIT clauses. More... | |
mysqlx_result_t * | mysqlx_table_insert (mysqlx_table_t *table,...) |
Execute a table INSERT statement with one row. More... | |
mysqlx_result_t * | mysqlx_table_delete (mysqlx_table_t *table, const char *criteria) |
Execute a table DELETE statement with a WHERE clause. More... | |
mysqlx_result_t * | mysqlx_table_update (mysqlx_table_t *table, const char *criteria,...) |
Execute a table UPDATE statement. More... | |
mysqlx_stmt_t * | mysqlx_table_select_new (mysqlx_table_t *table) |
Create a statement which performs a table SELECT operation. More... | |
mysqlx_stmt_t * | mysqlx_table_insert_new (mysqlx_table_t *table) |
Create a statement executing a table INSERT operation. More... | |
int | mysqlx_set_insert_columns (mysqlx_stmt_t *stmt,...) |
Specify column names for an INSERT statement. More... | |
mysqlx_stmt_t * | mysqlx_table_delete_new (mysqlx_table_t *table) |
Create a statement executing a table DELETE operation. More... | |
mysqlx_stmt_t * | mysqlx_table_update_new (mysqlx_table_t *table) |
Create a statement executing a table UPDATE operation. More... | |
int | mysqlx_set_update_values (mysqlx_stmt_t *stmt,...) |
Set values for the columns in the UPDATE statement. More... | |
Macros | |
#define | mysqlx_set_find_group_by mysqlx_set_group_by |
A macro defining a function for setting GROUP BY for FIND operation. More... | |
#define | mysqlx_set_select_items mysqlx_set_items |
A macro defining a function for setting projections for SELECT operation. More... | |
#define | mysqlx_set_select_where mysqlx_set_where |
A macro defining a function for setting WHERE for SELECT operation. More... | |
#define | mysqlx_set_select_order_by mysqlx_set_order_by |
A macro defining a function for setting ORDER BY for SELECT operation. More... | |
#define | mysqlx_set_select_group_by mysqlx_set_group_by |
A macro defining a function for setting GROUP BY for SELECT operation. More... | |
#define | mysqlx_set_select_limit_and_offset mysqlx_set_limit_and_offset |
A macro defining a function for setting LIMIT for SELECT operation. More... | |
#define | mysqlx_set_delete_where mysqlx_set_where |
A macro defining a function for setting WHERE clause for DELETE operation. More... | |
#define | mysqlx_set_delete_limit(STMT, LIM) mysqlx_set_limit_and_offset(STMT, LIM, 0) |
A macro defining a function for setting LIMIT for DELETE operation. More... | |
#define | mysqlx_set_delete_order_by mysqlx_set_order_by |
A macro defining a function for setting ORDER BY for DELETE operation. More... | |
#define | mysqlx_set_update_where mysqlx_set_where |
A macro defining a function for setting WHERE clause for UPDATE operation. More... | |
#define | mysqlx_set_update_limit(STMT, LIM) mysqlx_set_limit_and_offset(STMT, LIM, 0) |
A macro defining a function for setting LIMIT for UPDATE operation. More... | |
#define | mysqlx_set_update_order_by mysqlx_set_order_by |
A macro defining a function for setting ORDER BY clause for UPDATE operation. More... | |
#define mysqlx_set_find_group_by mysqlx_set_group_by |
A macro defining a function for setting GROUP BY for FIND operation.
#define mysqlx_set_select_items mysqlx_set_items |
A macro defining a function for setting projections for SELECT operation.
#define mysqlx_set_select_where mysqlx_set_where |
A macro defining a function for setting WHERE for SELECT operation.
#define mysqlx_set_select_order_by mysqlx_set_order_by |
A macro defining a function for setting ORDER BY for SELECT operation.
#define mysqlx_set_select_group_by mysqlx_set_group_by |
A macro defining a function for setting GROUP BY for SELECT operation.
#define mysqlx_set_select_limit_and_offset mysqlx_set_limit_and_offset |
A macro defining a function for setting LIMIT for SELECT operation.
#define mysqlx_set_delete_where mysqlx_set_where |
A macro defining a function for setting WHERE clause for DELETE operation.
#define mysqlx_set_delete_limit | ( | STMT, | |
LIM | |||
) | mysqlx_set_limit_and_offset(STMT, LIM, 0) |
A macro defining a function for setting LIMIT for DELETE operation.
#define mysqlx_set_delete_order_by mysqlx_set_order_by |
A macro defining a function for setting ORDER BY for DELETE operation.
#define mysqlx_set_update_where mysqlx_set_where |
A macro defining a function for setting WHERE clause for UPDATE operation.
#define mysqlx_set_update_limit | ( | STMT, | |
LIM | |||
) | mysqlx_set_limit_and_offset(STMT, LIM, 0) |
A macro defining a function for setting LIMIT for UPDATE operation.
#define mysqlx_set_update_order_by mysqlx_set_order_by |
A macro defining a function for setting ORDER BY clause for UPDATE operation.
mysqlx_result_t * mysqlx_table_select | ( | mysqlx_table_t * | table, |
const char * | criteria | ||
) |
Execute a table SELECT statement with a WHERE clause.
All columns will be selected.
table | table handle |
criteria | row selection criteria (WHERE clause); if NULL then all rows in the table are returned. |
mysqlx_error()
function mysqlx_result_t * mysqlx_table_select_limit | ( | mysqlx_table_t * | table, |
const char * | criteria, | ||
uint64_t | row_count, | ||
uint64_t | offset, | ||
... | |||
) |
Execute a table SELECT statement with a WHERE, ORDER BY and LIMIT clauses.
table | table handle |
criteria | row selection criteria (WHERE clause); if NULL then all rows in the table will be selected. |
row_count | a number of rows to return (LIMIT clause) |
offset | number of rows to skip (an offset for the LIMIT clause) |
... | sorting specification - variable parameters list consisting of (expression, direction) pairs terminated by PARAM_END : expr_1, direction_1, ..., expr_n, direction_n, PARAM_END . Each expression computes a value used to sort the rows/documents in ascending or descending order, as determined by direction constant (TODO: list the direction enum names). Special attention must be paid to the expression strings because the empty string "" or NULL will be treated as the end of sequence |
mysqlx_error()
function mysqlx_result_t * mysqlx_table_insert | ( | mysqlx_table_t * | table, |
... | |||
) |
Execute a table INSERT statement with one row.
table | table handle |
... | list of column-value specifications consisting of <column_name, value_type, value> triplets. The list should be terminated using PARAM_END . Allowed value types are listed in mysqlx_data_type_t enum. The X DevAPI for C defines the convenience macros that help to specify the types and values: See PARAM_SINT() , PARAM_UINT() , PARAM_FLOAT() , PARAM_DOUBLE() , PARAM_BYTES() , PARAM_STRING() : |
..., "col_uint", PARAM_UINT(uint_val), "col_blob", PARAM_BYTES(byte_buf, buf_len), PARAM_END
mysqlx_error()
function mysqlx_result_t * mysqlx_table_delete | ( | mysqlx_table_t * | table, |
const char * | criteria | ||
) |
Execute a table DELETE statement with a WHERE clause.
table | table handle |
criteria | expression selecting rows to be deleted; if this parameter is NULL all rows are deleted |
mysqlx_error()
function mysqlx_result_t * mysqlx_table_update | ( | mysqlx_table_t * | table, |
const char * | criteria, | ||
... | |||
) |
Execute a table UPDATE statement.
table | table handle |
criteria | expression selecting rows to be updated (WHERE clause) |
... | list of column-value specifications consisting of <column_name, value_type, value> triplets. The list should be terminated using PARAM_END . Allowed value types are listed in mysqlx_data_type_t enum. The X DevAPI for C defines the convenience macros that help to specify the types and values: See PARAM_SINT() , PARAM_UINT() , PARAM_FLOAT() , PARAM_DOUBLE() , PARAM_BYTES() , PARAM_STRING() , PARAM_EXPR() : |
..., "col_uint", PARAM_EXPR("col_uint * 100"), "col_blob", PARAM_BYTES(byte_buf, buf_len), PARAM_END
mysqlx_error()
function mysqlx_stmt_t * mysqlx_table_select_new | ( | mysqlx_table_t * | table | ) |
Create a statement which performs a table SELECT operation.
table | table handle |
mysqlx_execute()
.mysqlx_stmt_t * mysqlx_table_insert_new | ( | mysqlx_table_t * | table | ) |
Create a statement executing a table INSERT operation.
table | table handle |
mysqlx_execute()
int mysqlx_set_insert_columns | ( | mysqlx_stmt_t * | stmt, |
... | |||
) |
Specify column names for an INSERT statement.
The function specifies the names of the columns into which the statement will insert data. User code must ensure that the column values are correct because the names are not validated until receiving the query on the server side after executing with mysqlx_execute()
.
stmt | statement handle |
... | variable parameters list consisting of column names; the list is terminated by PARAM_END. |
RESULT_OK
- on success; RESULT_ERROR
- on errormysqlx_stmt_t * mysqlx_table_delete_new | ( | mysqlx_table_t * | table | ) |
Create a statement executing a table DELETE operation.
table | table handle |
mysqlx_execute()
.mysqlx_stmt_t * mysqlx_table_update_new | ( | mysqlx_table_t * | table | ) |
Create a statement executing a table UPDATE operation.
table | table handle |
mysqlx_execute()
after specifying what updates should it perform.int mysqlx_set_update_values | ( | mysqlx_stmt_t * | stmt, |
... | |||
) |
Set values for the columns in the UPDATE statement.
stmt | statement handle |
... | variable parameters list consisting of triplets <column_name, value_type, value_or_expression> representing column names, value types and values as expressions. The list is terminated by PARAM_END : column_1, type_1, val_1, ..., column_n, type_n, val_n, PARAM_END . The value type is defined in mysqlx_data_type_t enum. If the value is to be computed on the server side the type has to be set to MYSQLX_TYPE_EXPR . The value (expression) should be specified as a character string expression. For MYSQLX_TYPE_BYTES the function will expect four parameters instead of three as for all other types: <column_name, MYSQLX_TYPE_BYTES , (void*)byte_data, (size_t)length> |
RESULT_OK
- on success; RESULT_ERROR
- on errorparam
list must be not empty, otherwise error is reported.