80#include "common_constants.h"
81#include "common/api.h"
98typedef char object_id[16];
99typedef object_id* MYSQLX_GUID;
111#define RESULT_MORE_DATA 8
119#define RESULT_NULL 16
126#define RESULT_INFO 32
130#define RESULT_WARNING 64
134#define RESULT_ERROR 128
137#define MYSQLX_MAX_ERROR_LEN 255
138#define MYSQLX_NULL_TERMINATED 0xFFFFFFFF
140#define MYSQLX_ERR_UNKNOWN 0xFFFF
142#define MYSQLX_COLLATION_UNDEFINED 0
149#define MYSQLX_ERROR_INDEX_OUT_OF_RANGE 1
155#define MYSQLX_ERROR_INDEX_OUT_OF_RANGE_MSG "Index is out of range"
156#define MYSQLX_ERROR_MISSING_SCHEMA_NAME_MSG "Missing schema name"
157#define MYSQLX_ERROR_MISSING_TABLE_NAME_MSG "Missing table name"
158#define MYSQLX_ERROR_MISSING_VIEW_NAME_MSG "Missing view name"
159#define MYSQLX_ERROR_MISSING_COLLECTION_NAME_MSG "Missing collection name"
160#define MYSQLX_ERROR_MISSING_COLLECTION_OPT_MSG "Missing collection options"
161#define MYSQLX_ERROR_MISSING_VIEW_NAME_MSG "Missing view name"
162#define MYSQLX_ERROR_MISSING_KEY_NAME_MSG "Missing key name"
163#define MYSQLX_ERROR_MISSING_HOST_NAME "Missing host name"
164#define MYSQLX_ERROR_MISSING_SOCKET_NAME "Missing socket name"
165#define MYSQLX_ERROR_MISSING_CONN_INFO "Missing connecting information"
166#define MYSQLX_ERROR_HANDLE_NULL_MSG "Handle cannot be NULL"
167#define MYSQLX_ERROR_VIEW_INVALID_STMT_TYPE "Invalid statement type for View. Only SELECT type is supported"
168#define MYSQLX_ERROR_VIEW_TYPE_MSG "Statement must be of VIEW type"
169#define MYSQLX_ERROR_OUTPUT_BUFFER_NULL "The output buffer cannot be NULL"
170#define MYSQLX_ERROR_OUTPUT_BUFFER_ZERO "The output buffer cannot have zero length"
171#define MYSQLX_ERROR_OUTPUT_VARIABLE_NULL "The output variable cannot be NULL"
172#define MYSQLX_ERROR_OP_NOT_SUPPORTED "The operation is not supported by the function"
173#define MYSQLX_ERROR_WRONG_SSL_MODE "Wrong value for SSL Mode"
174#define MYSQLX_ERROR_NO_TLS_SUPPORT "Can not create TLS session - this connector is built without TLS support"
175#define MYSQLX_ERROR_MIX_PRIORITY "Mixing hosts with and without priority is not allowed"
176#define MYSQLX_ERROR_DUPLICATED_OPTION "Option already defined"
177#define MYSQLX_ERROR_MAX_PRIORITY "Priority should be a value between 0 and 100"
178#define MYSQLX_ERROR_AUTH_METHOD "Unknown authentication method"
179#define MYSQLX_ERROR_ROW_LOCKING "Row locking is supported only for SELECT and FIND"
180#define MYSQLX_ERROR_WRONG_LOCKING_MODE "Wrong value for the row locking mode"
181#define MYSQLX_ERROR_WRONG_EXPRESSION "Expression could not be parsed"
182#define MYSQLX_ERROR_EMPTY_JSON "Empty JSON document string"
279typedef struct Mysqlx_diag_base mysqlx_object_t;
308typedef enum mysqlx_data_type_enum
310 MYSQLX_TYPE_UNDEFINED = 0,
336#define PARAM_SINT(A) (void*)MYSQLX_TYPE_SINT, (int64_t)A
337#define PARAM_UINT(A) (void*)MYSQLX_TYPE_UINT, (uint64_t)A
338#define PARAM_FLOAT(A) (void*)MYSQLX_TYPE_FLOAT, (double)A
339#define PARAM_DOUBLE(A) (void*)MYSQLX_TYPE_DOUBLE, (double)A
340#define PARAM_BYTES(DATA, SIZE) (void*)MYSQLX_TYPE_BYTES, (void*)DATA, (size_t)SIZE
341#define PARAM_STRING(A) (void*)MYSQLX_TYPE_STRING, A
342#define PARAM_EXPR(A) (void*)MYSQLX_TYPE_EXPR, A
343#define PARAM_NULL() (void*)MYSQLX_TYPE_NULL
345#define PARAM_END (void*)0
352typedef enum mysqlx_sort_direction_enum
359#define PARAM_SORT_ASC(A) A, SORT_ORDER_ASC
360#define PARAM_SORT_DESC(A) A, SORT_ORDER_DESC
368typedef enum mysqlx_client_opt_type_enum
371#define XAPI_CLIENT_OPT_ENUM_str(X,N) MYSQLX_CLIENT_OPT_##X = -N,
372#define XAPI_CLIENT_OPT_ENUM_bool(X,N) MYSQLX_CLIENT_OPT_##X = -N,
373#define XAPI_CLIENT_OPT_ENUM_num(X,N) MYSQLX_CLIENT_OPT_##X = -N,
374#define XAPI_CLIENT_OPT_ENUM_any(X,N) MYSQLX_CLIENT_OPT_##X = -N,
376 CLIENT_OPTION_LIST(XAPI_CLIENT_OPT_ENUM)
380#define OPT_POOLING(A) MYSQLX_CLIENT_OPT_POOLING, (int)(bool)(A)
381#define OPT_POOL_MAX_SIZE(A) MYSQLX_CLIENT_OPT_POOL_MAX_SIZE, (uint64_t)(A)
382#define OPT_POOL_QUEUE_TIMEOUT(A) MYSQLX_CLIENT_OPT_POOL_QUEUE_TIMEOUT, (uint64_t)(A)
383#define OPT_POOL_MAX_IDLE_TIME(A) MYSQLX_CLIENT_OPT_POOL_MAX_IDLE_TIME, (uint64_t)(A)
397typedef enum mysqlx_opt_type_enum
400#define XAPI_OPT_ENUM_str(X,N) MYSQLX_OPT_##X = N,
401#define XAPI_OPT_ENUM_num(X,N) MYSQLX_OPT_##X = N,
402#define XAPI_OPT_ENUM_any(X,N) MYSQLX_OPT_##X = N,
403#define XAPI_OPT_ENUM_bool(X,N) MYSQLX_OPT_##X = N,
405 SESSION_OPTION_LIST(XAPI_OPT_ENUM)
410#define OPT_HOST(A) MYSQLX_OPT_HOST, (A)
411#define OPT_PORT(A) MYSQLX_OPT_PORT, (unsigned int)(A)
413#define OPT_SOCKET(A) MYSQLX_OPT_SOCKET, (A)
415#define OPT_DNS_SRV(A) MYSQLX_OPT_DNS_SRV, (A)
416#define OPT_USER(A) MYSQLX_OPT_USER, (A)
417#define OPT_PWD(A) MYSQLX_OPT_PWD, (A)
418#define OPT_DB(A) MYSQLX_OPT_DB, (A)
419#define OPT_SSL_MODE(A) MYSQLX_OPT_SSL_MODE, (A)
420#define OPT_SSL_CA(A) MYSQLX_OPT_SSL_CA, (A)
421#define OPT_SSL_CAPATH(A) MYSQLX_OPT_SSL_CAPATH, (A)
422#define OPT_SSL_CRL(A) MYSQLX_OPT_SSL_CRL, (A)
423#define OPT_SSL_CRLPATH(A) MYSQLX_OPT_SSL_CRLPATH, (A)
424#define OPT_PRIORITY(A) MYSQLX_OPT_PRIORITY, (unsigned int)(A)
425#define OPT_AUTH(A) MYSQLX_OPT_AUTH, (unsigned int)(A)
426#define OPT_CONNECT_TIMEOUT(A) MYSQLX_OPT_CONNECT_TIMEOUT, (unsigned int)(A)
427#define OPT_CONNECTION_ATTRIBUTES(A) MYSQLX_OPT_CONNECTION_ATTRIBUTES, (A)
428#define OPT_TLS_VERSIONS(A) MYSQLX_OPT_TLS_VERSIONS, (A)
429#define OPT_TLS_CIPHERSUITES(A) MYSQLX_OPT_TLS_CIPHERSUITES, (A)
430#define OPT_COMPRESSION(A) MYSQLX_OPT_COMPRESSION, (unsigned int)(A)
431#define OPT_COMPRESSION_ALGORITHMS(A) MYSQLX_OPT_COMPRESSION_ALGORITHMS, (const char*)(A)
440typedef enum mysqlx_ssl_mode_enum
442#define XAPI_SSL_MODE_ENUM(X,N) SSL_MODE_##X = N,
444 SSL_MODE_LIST(XAPI_SSL_MODE_ENUM)
454typedef enum mysqlx_auth_method_enum
456#define XAPI_AUTH_ENUM(X,N) MYSQLX_AUTH_##X = N,
458 AUTH_METHOD_LIST(XAPI_AUTH_ENUM)
468typedef enum mysqlx_collection_opt_enum
471#define XAPI_COLLECTION_OPT_ENUM(X,N) MYSQLX_OPT_COLLECTION_##X = N,
473 COLLECTION_OPTIONS_OPTION(XAPI_COLLECTION_OPT_ENUM)
474 MYSQLX_OPT_COLLECTION_LAST
484typedef enum mysqlx_collection_validation_opt_enum
487#define XAPI_COLLECTION_VALIDATION_OPT_ENUM(X,N) MYSQLX_OPT_COLLECTION_VALIDATION_##X = 1024+N,
489 COLLECTION_VALIDATION_OPTION(XAPI_COLLECTION_VALIDATION_OPT_ENUM)
490 MYSQLX_OPT_COLLECTION_VALIDATION_LAST
499typedef enum mysqlx_collection_validation_level_enum
502#define XAPI_COLLECTION_VALIDATION_LEVEL_ENUM(X,N) MYSQLX_OPT_COLLECTION_VALIDATION_LEVEL_##X = 2048+N,
504 COLLECTION_VALIDATION_LEVEL(XAPI_COLLECTION_VALIDATION_LEVEL_ENUM)
505 MYSQLX_OPT_COLLECTION_VALIDATION_LEVEL_LAST
509#define VALIDATION_OFF MYSQLX_OPT_COLLECTION_VALIDATION_LEVEL_OFF
510#define VALIDATION_STRICT MYSQLX_OPT_COLLECTION_VALIDATION_LEVEL_STRICT
512#define OPT_COLLECTION_REUSE(X) MYSQLX_OPT_COLLECTION_REUSE, (unsigned int)X
513#define OPT_COLLECTION_VALIDATION(X) MYSQLX_OPT_COLLECTION_VALIDATION, (const char*)X
514#define OPT_COLLECTION_VALIDATION_LEVEL(X) MYSQLX_OPT_COLLECTION_VALIDATION_LEVEL, (unsigned int)X
515#define OPT_COLLECTION_VALIDATION_SCHEMA(X) MYSQLX_OPT_COLLECTION_VALIDATION_SCHEMA, (const char*)X
521typedef enum mysqlx_compression_mode_enum
523#define XAPI_COMPRESSION_ENUM(X,N) MYSQLX_COMPRESSION_##X = N,
525 COMPRESSION_MODE_LIST(XAPI_COMPRESSION_ENUM)
534typedef enum mysqlx_row_locking_enum
536#define XAPI_ROW_LOCK_ENUM(X,N) ROW_LOCK_##X = N,
539 LOCK_MODE_LIST(XAPI_ROW_LOCK_ENUM)
548typedef enum mysqlx_lock_contention_enum
550#define XAPI_LOCK_CONTENTION_ENUM(X,N) LOCK_CONTENTION_##X = N,
552 LOCK_CONTENTION_LIST(XAPI_LOCK_CONTENTION_ENUM)
747 const char *password,
const char *database,
974 const char *table_pattern,
1024 const char *col_pattern);
1048 unsigned int check);
1123PUBLIC_API
const char*
1312 size_t query_len, ...);
1474 const char *criteria, ...);
1495 const char *criteria, ...);
1517 const char *criteria,
1518 const char *patch_spec);
1536 const char *patch_spec);
1594#define mysqlx_set_find_criteria mysqlx_set_where
1604#define mysqlx_set_find_having mysqlx_set_having
1614#define mysqlx_set_find_group_by mysqlx_set_group_by
1624#define mysqlx_set_find_limit_and_offset(STMT, LIM, OFFS) mysqlx_set_limit_and_offset(STMT, LIM, OFFS)
1634#define mysqlx_set_find_order_by mysqlx_set_order_by
1645#define mysqlx_set_find_row_locking mysqlx_set_row_locking
1725#define mysqlx_set_remove_criteria mysqlx_set_where
1735#define mysqlx_set_remove_order_by mysqlx_set_order_by
1745#define mysqlx_set_remove_limit_and_offset mysqlx_set_limit_and_offset
1880#define mysqlx_set_modify_criteria mysqlx_set_where
1955 uint64_t row_count, uint64_t offset, ...);
2032 const char *criteria,
2071#define mysqlx_set_select_items mysqlx_set_items
2081#define mysqlx_set_select_where mysqlx_set_where
2092#define mysqlx_set_select_order_by mysqlx_set_order_by
2102#define mysqlx_set_select_having mysqlx_set_having
2112#define mysqlx_set_select_group_by mysqlx_set_group_by
2122#define mysqlx_set_select_limit_and_offset mysqlx_set_limit_and_offset
2133#define mysqlx_set_select_row_locking mysqlx_set_row_locking
2239#define mysqlx_set_delete_where mysqlx_set_where
2248#define mysqlx_set_delete_limit(STMT, LIM) mysqlx_set_limit_and_offset(STMT, LIM, 0)
2257#define mysqlx_set_delete_order_by mysqlx_set_order_by
2322#define mysqlx_set_update_where mysqlx_set_where
2332#define mysqlx_set_update_limit(STMT, LIM) mysqlx_set_limit_and_offset(STMT, LIM, 0)
2343#define mysqlx_set_update_order_by mysqlx_set_order_by
2829PUBLIC_API
const char *
2901 uint64_t offset,
void *buf,
size_t *buf_len);
3126PUBLIC_API
const char *
3141PUBLIC_API
const char *
3156PUBLIC_API
const char *
3171PUBLIC_API
const char *
3186PUBLIC_API
const char *
3201PUBLIC_API
const char *
3326 const char *collection,
3378 const char *collection,
3379 const char* json_options);
3383 const char *collection,
3388 const char* collection,
3389 const char* json_options);
3523 const char *idx_spec);
int mysqlx_table_count(mysqlx_table_t *table, uint64_t *count)
Return a number of rows in a table.
int mysqlx_set_modify_array_append(mysqlx_stmt_t *stmt,...)
Append to array fields in a document.
mysqlx_stmt_t * mysqlx_collection_find_new(mysqlx_collection_t *collection)
Create a statement which finds documents in a collection.
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 t...
mysqlx_result_t * mysqlx_collection_find(mysqlx_collection_t *collection, const char *criteria)
Execute a collection FIND statement with a specific find criteria.
mysqlx_result_t * mysqlx_collection_remove(mysqlx_collection_t *collection, const char *criteria)
Remove documents from a collection.
int mysqlx_set_modify_unset(mysqlx_stmt_t *stmt,...)
Unset fields in a document.
int mysqlx_collection_count(mysqlx_collection_t *collection, uint64_t *count)
Return a number of documents in a collection.
int mysqlx_set_modify_array_insert(mysqlx_stmt_t *stmt,...)
Insert elements into array fields in a document.
int mysqlx_set_modify_array_delete(mysqlx_stmt_t *stmt,...)
Delete elements from array fields in a document.
mysqlx_result_t * mysqlx_collection_modify_set(mysqlx_collection_t *collection, const char *criteria,...)
Modify documents in the collection.
mysqlx_result_t * mysqlx_collection_add(mysqlx_collection_t *collection,...)
Add a set of new documents to a collection.
mysqlx_stmt_t * mysqlx_collection_remove_new(mysqlx_collection_t *collection)
Create a statement which removes documents from a collection.
int mysqlx_set_add_document(mysqlx_stmt_t *stmt, const char *json_doc)
Specify a document to be added to a collection.
int mysqlx_set_modify_set(mysqlx_stmt_t *stmt,...)
Set fields in a document to given values.
mysqlx_stmt_t * mysqlx_collection_add_new(mysqlx_collection_t *collection)
Create a statement which adds documents to a collection.
mysqlx_result_t * mysqlx_collection_modify_unset(mysqlx_collection_t *collection, const char *criteria,...)
Unset fields in documents from the collection.
int mysqlx_set_find_projection(mysqlx_stmt_t *stmt, const char *proj)
Specify a projection for a collection find query.
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.
mysqlx_stmt_t * mysqlx_collection_modify_new(mysqlx_collection_t *collection)
Create a statement which modifies documents in a collection.
int mysqlx_schema_drop(mysqlx_session_t *sess, const char *schema)
Drop a schema.
mysqlx_collection_options_t * mysqlx_collection_options_new()
Allocate a new create/modify collection options data.
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.
int mysqlx_collection_options_set(mysqlx_collection_options_t *options,...)
Set collection options.
int mysqlx_collection_create_index(mysqlx_collection_t *coll, const char *name, const char *idx_spec)
Create index for a collection.
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.
int mysqlx_collection_drop_index(mysqlx_collection_t *coll, const char *name)
Drop index on a collection.
int mysqlx_schema_create(mysqlx_session_t *sess, const char *schema)
Create a schema.
int mysqlx_collection_create(mysqlx_schema_t *schema, const char *collection)
Create a new collection in a specified schema.
int mysqlx_collection_drop(mysqlx_schema_t *schema, const char *collection)
Drop an existing collection in a specified schema.
mysqlx_error_t * mysqlx_error(void *obj)
Get the last error from the object.
unsigned int mysqlx_result_warning_count(mysqlx_result_t *res)
Get the number of warnings generated by a statement.
mysqlx_error_t * mysqlx_result_next_warning(mysqlx_result_t *res)
Get the next warning from the result.
const char * mysqlx_error_message(void *obj)
Get the error message from the object.
unsigned int mysqlx_error_num(void *obj)
Get the error number from the object.
const char * mysqlx_column_get_schema(mysqlx_result_t *res, uint32_t pos)
Get column's schema name.
const char * mysqlx_column_get_original_table(mysqlx_result_t *res, uint32_t pos)
Get column's original table name.
const char * mysqlx_column_get_name(mysqlx_result_t *res, uint32_t pos)
Get column name.
uint32_t mysqlx_column_get_length(mysqlx_result_t *res, uint32_t pos)
Get column length.
uint32_t mysqlx_column_get_count(mysqlx_result_t *res)
Get the number of columns in the result.
const char * mysqlx_column_get_original_name(mysqlx_result_t *res, uint32_t pos)
Get column original name.
const char * mysqlx_column_get_table(mysqlx_result_t *res, uint32_t pos)
Get column's table name.
uint16_t mysqlx_column_get_collation(mysqlx_result_t *res, uint32_t pos)
Get column collation number.
const char * mysqlx_column_get_catalog(mysqlx_result_t *res, uint32_t pos)
Get column's catalog name.
uint16_t mysqlx_column_get_precision(mysqlx_result_t *res, uint32_t pos)
Get column precision.
uint16_t mysqlx_column_get_type(mysqlx_result_t *res, uint32_t pos)
Get column type identifier.
const char * mysqlx_fetch_generated_id(mysqlx_result_t *result)
Get identifiers of the documents added to the collection.
uint64_t mysqlx_get_affected_count(mysqlx_result_t *res)
Get number of rows affected by a statement.
int mysqlx_store_result(mysqlx_result_t *result, size_t *num)
Store result data in an internal buffer.
int mysqlx_get_float(mysqlx_row_t *row, uint32_t col, float *val)
Get a float number from a row.
int mysqlx_get_uint(mysqlx_row_t *row, uint32_t col, uint64_t *val)
Get an unsigned integer number from a row.
mysqlx_row_t * mysqlx_row_fetch_one(mysqlx_result_t *res)
Fetch one row from the result.
const char * mysqlx_json_fetch_one(mysqlx_result_t *res, size_t *out_length)
Fetch one document as a JSON string.
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.
int mysqlx_get_double(mysqlx_row_t *row, uint32_t col, double *val)
Get a double number from a row.
int mysqlx_get_count(mysqlx_result_t *result, size_t *num)
Function for getting the number of remaining cached items in a result.
int mysqlx_next_result(mysqlx_result_t *res)
Proceed to the next result set in the reply.
int mysqlx_get_sint(mysqlx_row_t *row, uint32_t col, int64_t *val)
Get a signed integer number from a row.
void mysqlx_result_free(mysqlx_result_t *res)
Free the result explicitly.
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 ...
mysqlx_session_options_t * mysqlx_session_options_new()
Allocate a new session configuration data object.
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.
int mysqlx_session_option_set(mysqlx_session_options_t *opth,...)
Set session configuration options.
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.
int mysqlx_session_option_get(mysqlx_session_options_t *opth, int opt,...)
Read session configuration options.
mysqlx_session_t * mysqlx_get_session_from_url(const char *conn_string, mysqlx_error_t **error)
Create a session using connection string or URL.
mysqlx_result_t * mysqlx_get_schemas(mysqlx_session_t *sess, const char *schema_pattern)
Get a list of schemas.
void mysqlx_free_options(mysqlx_session_options_t *opt)
Free a session configuration data object.
int mysqlx_transaction_begin(mysqlx_session_t *sess)
Begin a transaction for the session.
int mysqlx_rollback_to(mysqlx_session_t *sess, const char *name)
Roll back to savepoint created by mysqlx_savepoint_set().
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.
void mysqlx_session_close(mysqlx_session_t *session)
Close the session.
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.
int mysqlx_savepoint_release(mysqlx_session_t *sess, const char *name)
Release savepoint created by mysqlx_savepoint_set().
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.
void mysqlx_client_close(mysqlx_client_t *client)
Close the client pool and all sessions created by them.
mysqlx_result_t * mysqlx_get_collections(mysqlx_schema_t *schema, const char *col_pattern)
Get a list of collections in a schema.
int mysqlx_transaction_commit(mysqlx_session_t *sess)
Commit a transaction for the session.
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.
int mysqlx_session_valid(mysqlx_session_t *sess)
Check the session validity.
const char * mysqlx_savepoint_set(mysqlx_session_t *sess, const char *name)
Create savepoint inside transaction.
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.
mysqlx_session_t * mysqlx_get_session_from_options(mysqlx_session_options_t *opt, mysqlx_error_t **error)
Create a session using session configuration data.
int mysqlx_transaction_rollback(mysqlx_session_t *sess)
Roll back a transaction for the session.
mysqlx_result_t * mysqlx_sql(mysqlx_session_t *sess, const char *query, size_t query_len)
Execute a plain SQL query.
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.
mysqlx_result_t * mysqlx_sql_param(mysqlx_session_t *sess, const char *query, size_t query_len,...)
Execute a plain SQL query with parameters.
int mysqlx_set_order_by(mysqlx_stmt_t *stmt,...)
Specify ordering for a statement.
mysqlx_result_t * mysqlx_execute(mysqlx_stmt_t *stmt)
Execute a statement.
int mysqlx_set_row_locking(mysqlx_stmt_t *stmt, int locking, int contention)
Set row locking mode for a statement.
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.
int mysqlx_stmt_bind(mysqlx_stmt_t *stmt,...)
Bind values for parametrized statements.
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.
int mysqlx_set_insert_row(mysqlx_stmt_t *stmt,...)
Specify a row to be added by an INSERT statement.
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.
int mysqlx_set_items(mysqlx_stmt_t *stmt,...)
Specify a table query projection.
void mysqlx_free(void *obj)
Free the allocated handle explicitly.
int mysqlx_set_where(mysqlx_stmt_t *stmt, const char *where_expr)
Specify selection criteria for a statement.
mysqlx_stmt_t * mysqlx_table_delete_new(mysqlx_table_t *table)
Create a statement executing a table DELETE operation.
mysqlx_result_t * mysqlx_table_insert(mysqlx_table_t *table,...)
Execute a table INSERT statement with one row.
int mysqlx_set_insert_columns(mysqlx_stmt_t *stmt,...)
Specify column names for an INSERT statement.
mysqlx_result_t * mysqlx_table_delete(mysqlx_table_t *table, const char *criteria)
Execute a table DELETE statement with a WHERE clause.
mysqlx_stmt_t * mysqlx_table_update_new(mysqlx_table_t *table)
Create a statement executing a table UPDATE operation.
mysqlx_result_t * mysqlx_table_select(mysqlx_table_t *table, const char *criteria)
Execute a table SELECT statement with a WHERE clause.
mysqlx_stmt_t * mysqlx_table_select_new(mysqlx_table_t *table)
Create a statement which performs a table SELECT operation.
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.
mysqlx_stmt_t * mysqlx_table_insert_new(mysqlx_table_t *table)
Create a statement executing a table INSERT operation.
mysqlx_result_t * mysqlx_table_update(mysqlx_table_t *table, const char *criteria,...)
Execute a table UPDATE statement.
int mysqlx_set_update_values(mysqlx_stmt_t *stmt,...)
Set values for the columns in the UPDATE statement.
mysqlx_opt_type_t
Session options for use with mysqlx_session_option_get() and mysqlx_session_option_set() functions.
Definition: xapi.h:398
mysqlx_client_opt_type_t
Client options for use with mysqlx_session_option_get() and mysqlx_session_option_set() functions.
Definition: xapi.h:369
mysqlx_collection_validation_level_t
Collection validation level options .
Definition: xapi.h:496
mysqlx_lock_contention_t
Constants for defining the row locking options for mysqlx_set_row_locking() function.
Definition: xapi.h:542
struct mysqlx_result_struct mysqlx_result_t
Type of result handles.
Definition: xapi.h:301
mysqlx_collection_validation_opt_t
Collection validation options.
Definition: xapi.h:482
mysqlx_session_t * mysqlx_get_session_from_client(mysqlx_client_t *cli, mysqlx_error_t **error)
Create a new session.
struct mysqlx_row_struct mysqlx_row_t
Type of row handles.
Definition: xapi.h:288
mysqlx_collection_opt_t
Collection create/modify options.
Definition: xapi.h:467
struct mysqlx_stmt_struct mysqlx_stmt_t
Type of statement handles.
Definition: xapi.h:277
struct mysqlx_session_options_struct mysqlx_session_options_t
Type of handles for session configuration data.
Definition: xapi.h:227
struct mysqlx_session_struct mysqlx_session_t
Type of session handles.
Definition: xapi.h:205
mysqlx_data_type_t
The data type identifiers used in MYSQLX API.
Definition: xapi.h:309
struct mysqlx_client_struct mysqlx_client_t
Type of client handles.
Definition: xapi.h:213
struct mysqlx_collection_struct mysqlx_collection_t
Type of collection handles.
Definition: xapi.h:253
mysqlx_auth_method_t
Authentication method values for use with mysqlx_session_option_get() and mysqlx_session_option_set()...
Definition: xapi.h:454
mysqlx_compression_mode_t
Compression modes.
Definition: xapi.h:517
struct mysqlx_error_struct mysqlx_error_t
Type of error handles.
Definition: xapi.h:196
mysqlx_ssl_mode_t
Session SSL mode values for use with mysqlx_session_option_get() and mysqlx_session_option_set() func...
Definition: xapi.h:441
mysqlx_row_locking_t
Constants for defining the row locking options for mysqlx_set_row_locking() function.
Definition: xapi.h:529
struct mysqlx_schema_struct mysqlx_schema_t
Type of database schema handles.
Definition: xapi.h:244
struct mysqlx_collection_options_struct mysqlx_collection_options_t
Type of handles for collection create/modify options.
Definition: xapi.h:236
struct mysqlx_table_struct mysqlx_table_t
Type of table handles.
Definition: xapi.h:261
mysqlx_sort_direction_t
Sort directions in sorting operations such as ORDER BY.
Definition: xapi.h:353
@ MYSQLX_TYPE_DECIMAL
Decimal type.
Definition: xapi.h:323
@ MYSQLX_TYPE_BOOL
Bool type.
Definition: xapi.h:326
@ MYSQLX_TYPE_BIT
Bit type.
Definition: xapi.h:322
@ MYSQLX_TYPE_SINT
64-bit signed integer number type
Definition: xapi.h:313
@ MYSQLX_TYPE_TIME
Time type.
Definition: xapi.h:318
@ MYSQLX_TYPE_EXPR
Expression type.
Definition: xapi.h:333
@ MYSQLX_TYPE_FLOAT
Floating point float number type.
Definition: xapi.h:316
@ MYSQLX_TYPE_STRING
String type.
Definition: xapi.h:328
@ MYSQLX_TYPE_UINT
64-bit unsigned integer number type
Definition: xapi.h:314
@ MYSQLX_TYPE_DOUBLE
Floating point double number type.
Definition: xapi.h:315
@ MYSQLX_TYPE_ENUM
Enum type.
Definition: xapi.h:321
@ MYSQLX_TYPE_NULL
NULL value.
Definition: xapi.h:332
@ MYSQLX_TYPE_BYTES
Bytes array type.
Definition: xapi.h:317
@ MYSQLX_TYPE_GEOMETRY
Geometry type.
Definition: xapi.h:329
@ MYSQLX_TYPE_TIMESTAMP
Timestamp type.
Definition: xapi.h:330
@ MYSQLX_TYPE_SET
Set type.
Definition: xapi.h:320
@ MYSQLX_TYPE_DATETIME
Datetime type.
Definition: xapi.h:319
@ MYSQLX_TYPE_JSON
JSON type.
Definition: xapi.h:327
@ ROW_LOCK_NONE
No locking.
Definition: xapi.h:532
@ SORT_ORDER_ASC
Ascending sorting (Default)
Definition: xapi.h:354
@ SORT_ORDER_DESC
Descending sorting.
Definition: xapi.h:355