MySQL Connector/C++ 9.1.0
MySQL connector library for C and C++ applications
|
The main header for MySQL Connector/C++ X DevAPI for C. More...
Go to the source code of this file.
Macros | |
#define | RESULT_OK 0 |
Return value indicating function/operation success. | |
#define | RESULT_MORE_DATA 8 |
Return value flag indicating that the last reading operation did not finish reading to the end and there is still more data to be fetched by functions such as mysqlx_get_bytes() | |
#define | RESULT_NULL 16 |
Return value flag indicating end of data items (documents or rows) in a query result. More... | |
#define | RESULT_INFO 32 |
Return value flag indicating that operation generated information diagnostic entries. | |
#define | RESULT_WARNING 64 |
Return value flag indicating that operation generated warnings. | |
#define | RESULT_ERROR 128 |
Return value flag indicating function/operation error. | |
#define | mysqlx_set_find_criteria mysqlx_set_where |
A macro defining a function for setting criteria for FIND operation. More... | |
#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_find_limit_and_offset(STMT, LIM, OFFS) mysqlx_set_limit_and_offset(STMT, LIM, OFFS) |
A macro defining a function for setting LIMIT for DELETE operation. More... | |
#define | mysqlx_set_find_order_by mysqlx_set_order_by |
A macro defining a function for setting ORDER BY for SELECT operation. More... | |
#define | mysqlx_set_find_row_locking mysqlx_set_row_locking |
A macro defining a function for setting row locking mode for FIND operation. More... | |
#define | mysqlx_set_remove_criteria mysqlx_set_where |
A macro defining a function for setting WHERE for REMOVE operation. More... | |
#define | mysqlx_set_remove_order_by mysqlx_set_order_by |
A macro defining a function for setting ORDER BY for REMOVE operation. More... | |
#define | mysqlx_set_remove_limit_and_offset mysqlx_set_limit_and_offset |
A macro defining a function for setting LIMIT for REMOVE operation. More... | |
#define | mysqlx_set_modify_criteria mysqlx_set_where |
A macro defining a function for setting WHERE for MODIFY 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_select_row_locking mysqlx_set_row_locking |
A macro defining a function for setting row locking mode 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... | |
Typedefs | |
typedef struct mysqlx_error_struct | mysqlx_error_t |
Type of error handles. More... | |
typedef struct mysqlx_session_struct | mysqlx_session_t |
Type of session handles. More... | |
typedef struct mysqlx_client_struct | mysqlx_client_t |
Type of client handles. More... | |
typedef struct mysqlx_session_options_struct | mysqlx_session_options_t |
Type of handles for session configuration data. More... | |
typedef struct mysqlx_collection_options_struct | mysqlx_collection_options_t |
Type of handles for collection create/modify options. More... | |
typedef struct mysqlx_schema_struct | mysqlx_schema_t |
Type of database schema handles. More... | |
typedef struct mysqlx_collection_struct | mysqlx_collection_t |
Type of collection handles. More... | |
typedef struct mysqlx_table_struct | mysqlx_table_t |
Type of table handles. More... | |
typedef struct mysqlx_stmt_struct | mysqlx_stmt_t |
Type of statement handles. More... | |
typedef struct mysqlx_row_struct | mysqlx_row_t |
Type of row handles. More... | |
typedef struct mysqlx_result_struct | mysqlx_result_t |
Type of result handles. More... | |
Functions | |
mysqlx_client_t * | mysqlx_get_client_from_url (const char *conn_string, const char *client_opts, mysqlx_error_t **error) |
Create a client instance using connection string or URL and a client options JSON. More... | |
mysqlx_client_t * | mysqlx_get_client_from_options (mysqlx_session_options_t *opt, mysqlx_error_t **error) |
Create a client pool using session configuration data. More... | |
void | mysqlx_client_close (mysqlx_client_t *client) |
Close the client pool and all sessions created by them. More... | |
mysqlx_session_t * | mysqlx_get_session_from_client (mysqlx_client_t *cli, mysqlx_error_t **error) |
Create a new session. More... | |
mysqlx_session_t * | mysqlx_get_session (const char *host, int port, const char *user, const char *password, const char *database, mysqlx_error_t **error) |
Create a new session. More... | |
mysqlx_session_t * | mysqlx_get_session_from_url (const char *conn_string, mysqlx_error_t **error) |
Create a session using connection string or URL. More... | |
mysqlx_session_t * | mysqlx_get_session_from_options (mysqlx_session_options_t *opt, mysqlx_error_t **error) |
Create a session using session configuration data. More... | |
void | mysqlx_session_close (mysqlx_session_t *session) |
Close the session. More... | |
int | mysqlx_session_valid (mysqlx_session_t *sess) |
Check the session validity. More... | |
mysqlx_result_t * | mysqlx_get_schemas (mysqlx_session_t *sess, const char *schema_pattern) |
Get a list of schemas. More... | |
mysqlx_schema_t * | mysqlx_get_schema (mysqlx_session_t *sess, const char *schema_name, unsigned int check) |
Get a schema object and optionally check if it exists on the server. More... | |
mysqlx_result_t * | mysqlx_get_tables (mysqlx_schema_t *schema, const char *table_pattern, int get_views) |
Get a list of tables and views in a schema. More... | |
mysqlx_table_t * | mysqlx_get_table (mysqlx_schema_t *schema, const char *tab_name, unsigned int check) |
Get a table object and optionally check if it exists in the schema. More... | |
mysqlx_result_t * | mysqlx_get_collections (mysqlx_schema_t *schema, const char *col_pattern) |
Get a list of collections in a schema. More... | |
mysqlx_collection_t * | mysqlx_get_collection (mysqlx_schema_t *schema, const char *col_name, unsigned int check) |
Get a collection object and optionally check if it exists in the schema. More... | |
int | mysqlx_transaction_begin (mysqlx_session_t *sess) |
Begin a transaction for the session. More... | |
int | mysqlx_transaction_commit (mysqlx_session_t *sess) |
Commit a transaction for the session. More... | |
int | mysqlx_transaction_rollback (mysqlx_session_t *sess) |
Roll back a transaction for the session. More... | |
const char * | mysqlx_savepoint_set (mysqlx_session_t *sess, const char *name) |
Create savepoint inside transaction. More... | |
int | mysqlx_savepoint_release (mysqlx_session_t *sess, const char *name) |
Release savepoint created by mysqlx_savepoint_set(). More... | |
int | mysqlx_rollback_to (mysqlx_session_t *sess, const char *name) |
Roll back to savepoint created by mysqlx_savepoint_set(). More... | |
mysqlx_session_options_t * | mysqlx_session_options_new () |
Allocate a new session configuration data object. More... | |
void | mysqlx_free_options (mysqlx_session_options_t *opt) |
Free a session configuration data object. More... | |
int | mysqlx_session_option_set (mysqlx_session_options_t *opth,...) |
Set session configuration options. More... | |
int | mysqlx_session_option_get (mysqlx_session_options_t *opth, int opt,...) |
Read session configuration options. More... | |
mysqlx_result_t * | mysqlx_sql (mysqlx_session_t *sess, const char *query, size_t query_len) |
Execute a plain SQL query. More... | |
mysqlx_result_t * | mysqlx_sql_param (mysqlx_session_t *sess, const char *query, size_t query_len,...) |
Execute a plain SQL query with parameters. More... | |
mysqlx_stmt_t * | mysqlx_sql_new (mysqlx_session_t *sess, const char *query, uint32_t length) |
Create a statement which executes a plain SQL query. More... | |
int | mysqlx_collection_count (mysqlx_collection_t *collection, uint64_t *count) |
Return a number of documents in a collection. More... | |
mysqlx_result_t * | mysqlx_collection_find (mysqlx_collection_t *collection, const char *criteria) |
Execute a collection FIND statement with a specific find criteria. More... | |
mysqlx_result_t * | mysqlx_collection_add (mysqlx_collection_t *collection,...) |
Add a set of new documents to a collection. More... | |
mysqlx_result_t * | mysqlx_collection_remove (mysqlx_collection_t *collection, const char *criteria) |
Remove documents from a collection. More... | |
mysqlx_result_t * | mysqlx_collection_modify_set (mysqlx_collection_t *collection, const char *criteria,...) |
Modify documents in the collection. More... | |
mysqlx_result_t * | mysqlx_collection_modify_unset (mysqlx_collection_t *collection, const char *criteria,...) |
Unset fields in documents from the collection. More... | |
mysqlx_result_t * | mysqlx_collection_modify_patch (mysqlx_collection_t *collection, const char *criteria, const char *patch_spec) |
Apply a given patch to documents in a collection. More... | |
int | mysqlx_set_modify_patch (mysqlx_stmt_t *stmt, const char *patch_spec) |
Set a given patch for a modify statement to be applied to documents in a collection after executing the statement. More... | |
mysqlx_stmt_t * | mysqlx_collection_find_new (mysqlx_collection_t *collection) |
Create a statement which finds documents in a collection. More... | |
int | mysqlx_set_find_projection (mysqlx_stmt_t *stmt, const char *proj) |
Specify a projection for a collection find query. More... | |
mysqlx_stmt_t * | mysqlx_collection_add_new (mysqlx_collection_t *collection) |
Create a statement which adds documents to a collection. More... | |
int | mysqlx_set_add_document (mysqlx_stmt_t *stmt, const char *json_doc) |
Specify a document to be added to a collection. More... | |
mysqlx_stmt_t * | mysqlx_collection_remove_new (mysqlx_collection_t *collection) |
Create a statement which removes documents from a collection. More... | |
mysqlx_stmt_t * | mysqlx_collection_modify_new (mysqlx_collection_t *collection) |
Create a statement which modifies documents in a collection. More... | |
int | mysqlx_set_modify_set (mysqlx_stmt_t *stmt,...) |
Set fields in a document to given values. More... | |
int | mysqlx_set_modify_unset (mysqlx_stmt_t *stmt,...) |
Unset fields in a document. More... | |
int | mysqlx_set_modify_array_insert (mysqlx_stmt_t *stmt,...) |
Insert elements into array fields in a document. More... | |
int | mysqlx_set_modify_array_append (mysqlx_stmt_t *stmt,...) |
Append to array fields in a document. More... | |
int | mysqlx_set_modify_array_delete (mysqlx_stmt_t *stmt,...) |
Delete elements from array fields in a document. More... | |
int | mysqlx_table_count (mysqlx_table_t *table, uint64_t *count) |
Return a number of rows in a table. More... | |
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... | |
int | mysqlx_set_insert_row (mysqlx_stmt_t *stmt,...) |
Specify a row to be added by 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... | |
mysqlx_result_t * | mysqlx_execute (mysqlx_stmt_t *stmt) |
Execute a statement. More... | |
int | mysqlx_stmt_bind (mysqlx_stmt_t *stmt,...) |
Bind values for parametrized statements. More... | |
int | mysqlx_set_items (mysqlx_stmt_t *stmt,...) |
Specify a table query projection. More... | |
int | mysqlx_set_where (mysqlx_stmt_t *stmt, const char *where_expr) |
Specify selection criteria for a statement. More... | |
int | mysqlx_set_having (mysqlx_stmt_t *stmt, const char *having_expr) |
Specify filter conditions for a group of rows/documents or aggregates such as GROUP BY. More... | |
int | mysqlx_set_group_by (mysqlx_stmt_t *stmt,...) |
Specify one or more columns/values to group the result in conjunction with the aggregate functions. More... | |
int | mysqlx_set_order_by (mysqlx_stmt_t *stmt,...) |
Specify ordering for a statement. More... | |
int | mysqlx_set_limit_and_offset (mysqlx_stmt_t *stmt, uint64_t row_count, uint64_t offset) |
Set limit and offset information for a statement. More... | |
int | mysqlx_set_row_locking (mysqlx_stmt_t *stmt, int locking, int contention) |
Set row locking mode for a statement. More... | |
void | mysqlx_free (void *obj) |
Free the allocated handle explicitly. More... | |
mysqlx_row_t * | mysqlx_row_fetch_one (mysqlx_result_t *res) |
Fetch one row from the result. More... | |
const char * | mysqlx_json_fetch_one (mysqlx_result_t *res, size_t *out_length) |
Fetch one document as a JSON string. More... | |
int | mysqlx_next_result (mysqlx_result_t *res) |
Proceed to the next result set in the reply. More... | |
uint64_t | mysqlx_get_affected_count (mysqlx_result_t *res) |
Get number of rows affected by a statement. More... | |
int | mysqlx_store_result (mysqlx_result_t *result, size_t *num) |
Store result data in an internal buffer. More... | |
int | mysqlx_get_count (mysqlx_result_t *result, size_t *num) |
Function for getting the number of remaining cached items in a result. More... | |
const char * | mysqlx_fetch_generated_id (mysqlx_result_t *result) |
Get identifiers of the documents added to the collection. More... | |
uint64_t | mysqlx_get_auto_increment_value (mysqlx_result_t *res) |
Get auto increment value generated by a statement that inserts rows into a table with auto increment column. More... | |
int | mysqlx_get_bytes (mysqlx_row_t *row, uint32_t col, uint64_t offset, void *buf, size_t *buf_len) |
Read bytes stored in a row into a pre-allocated buffer. More... | |
int | mysqlx_get_uint (mysqlx_row_t *row, uint32_t col, uint64_t *val) |
Get an unsigned integer number from a row. More... | |
int | mysqlx_get_sint (mysqlx_row_t *row, uint32_t col, int64_t *val) |
Get a signed integer number from a row. More... | |
int | mysqlx_get_float (mysqlx_row_t *row, uint32_t col, float *val) |
Get a float number from a row. More... | |
int | mysqlx_get_double (mysqlx_row_t *row, uint32_t col, double *val) |
Get a double number from a row. More... | |
void | mysqlx_result_free (mysqlx_result_t *res) |
Free the result explicitly. More... | |
uint16_t | mysqlx_column_get_type (mysqlx_result_t *res, uint32_t pos) |
Get column type identifier. More... | |
uint16_t | mysqlx_column_get_collation (mysqlx_result_t *res, uint32_t pos) |
Get column collation number. More... | |
uint32_t | mysqlx_column_get_length (mysqlx_result_t *res, uint32_t pos) |
Get column length. More... | |
uint16_t | mysqlx_column_get_precision (mysqlx_result_t *res, uint32_t pos) |
Get column precision. More... | |
uint32_t | mysqlx_column_get_count (mysqlx_result_t *res) |
Get the number of columns in the result. More... | |
const char * | mysqlx_column_get_name (mysqlx_result_t *res, uint32_t pos) |
Get column name. More... | |
const char * | mysqlx_column_get_original_name (mysqlx_result_t *res, uint32_t pos) |
Get column original name. More... | |
const char * | mysqlx_column_get_table (mysqlx_result_t *res, uint32_t pos) |
Get column's table name. More... | |
const char * | mysqlx_column_get_original_table (mysqlx_result_t *res, uint32_t pos) |
Get column's original table name. More... | |
const char * | mysqlx_column_get_schema (mysqlx_result_t *res, uint32_t pos) |
Get column's schema name. More... | |
const char * | mysqlx_column_get_catalog (mysqlx_result_t *res, uint32_t pos) |
Get column's catalog name. More... | |
int | mysqlx_schema_create (mysqlx_session_t *sess, const char *schema) |
Create a schema. More... | |
int | mysqlx_schema_drop (mysqlx_session_t *sess, const char *schema) |
Drop a schema. More... | |
int | mysqlx_collection_create (mysqlx_schema_t *schema, const char *collection) |
Create a new collection in a specified schema. More... | |
mysqlx_collection_options_t * | mysqlx_collection_options_new () |
Allocate a new create/modify collection options data. More... | |
int | mysqlx_collection_options_set (mysqlx_collection_options_t *options,...) |
Set collection options. More... | |
int | mysqlx_collection_create_with_options (mysqlx_schema_t *schema, const char *collection, mysqlx_collection_options_t *options) |
Create a new collection in a specified schema. More... | |
int | mysqlx_collection_create_with_json_options (mysqlx_schema_t *schema, const char *collection, const char *json_options) |
Create a new collection in a specified schema. More... | |
int | mysqlx_collection_drop (mysqlx_schema_t *schema, const char *collection) |
Drop an existing collection in a specified schema. More... | |
mysqlx_error_t * | mysqlx_error (void *obj) |
Get the last error from the object. More... | |
const char * | mysqlx_error_message (void *obj) |
Get the error message from the object. More... | |
unsigned int | mysqlx_error_num (void *obj) |
Get the error number from the object. More... | |
unsigned int | mysqlx_result_warning_count (mysqlx_result_t *res) |
Get the number of warnings generated by a statement. More... | |
mysqlx_error_t * | mysqlx_result_next_warning (mysqlx_result_t *res) |
Get the next warning from the result. More... | |
int | mysqlx_collection_create_index (mysqlx_collection_t *coll, const char *name, const char *idx_spec) |
Create index for a collection. More... | |
int | mysqlx_collection_drop_index (mysqlx_collection_t *coll, const char *name) |
Drop index on a collection. More... | |
The main header for MySQL Connector/C++ X DevAPI for C.
This header should be included by C and C++ code which uses the X DevAPI for C implemented by MySQL Connector/C++