提交 7856dce0 编写于 作者: K kailixu

docs: taos api description

上级 c3e88143
......@@ -168,6 +168,12 @@ The base API is used to do things like create database connections and provide a
:::
- `TAOS *taos_connect_auth(const char *host, const char *user, const char *auth, const char *db, uint16_t port)`
The function is the same as taos_connect. Except that the pass parameter is replaced by auth, other parameters are the same as taos_connect.
- auth: the 32-bit lowercase md5 of the raw password
- `char *taos_get_server_info(TAOS *taos)`
Get server-side version information.
......@@ -184,6 +190,14 @@ The base API is used to do things like create database connections and provide a
- If len is less than the space required to store the db (including the last '\0'), an error is returned. The truncated data assigned in the database ends with '\0'.
- If len is greater than or equal to the space required to store the db (including the last '\0'), return normal 0, and assign the db name ending with '\0' in the database.
- `int taos_set_notify_cb(TAOS *taos, __taos_notify_fn_t fp, void *param, int type)`
Set the event callback function.
- fp: event callback function pointer. Declaration:typedef void (*__taos_notify_fn_t)(void *param, void *ext, int type);Param is a user-defined parameter, ext is an extended parameter (depending on the event type, and returns the user password version for TAOS_NOTIFY_PASSVER), and type is the event type
- param: user-defined parameter
- type: event type. Value range: 1) TAOS_NOTIFY_PASSVER: User password changed
- `void taos_close(TAOS *taos)`
Closes the connection, where `taos` is the handle returned by `taos_connect()`.
......@@ -358,6 +372,14 @@ The specific functions related to the interface are as follows (see also the [pr
Execute the prepared statement. Currently, a statement can only be executed once.
- `int taos_stmt_affected_rows(TAOS_STMT *stmt)`
Gets the number of rows affected by executing bind statements multiple times.
- `int taos_stmt_affected_rows_once(TAOS_STMT *stmt)`
Gets the number of rows affected by executing a bind statement once.
- `TAOS_RES* taos_stmt_use_result(TAOS_STMT *stmt)`
Gets the result set of a statement. Use the result set in the same way as in the non-parametric call. When finished, `taos_free_result()` should be called on this result set to free resources.
......
......@@ -258,9 +258,9 @@ int taos_print_row(char *str, TAOS_ROW row, TAOS_FIELD *fields, int num_fields)
- `TAOS *taos_connect_auth(const char *host, const char *user, const char *auth, const char *db, uint16_t port)`
功能同 taos_connect。除 pass 参数替换为 auth 外,其他参数同 taos_connect
功能同 taos_connect。除 pass 参数替换为 auth 外,其他参数同 taos_connect
- auth: 密码取 32 位小写 md5. e.g. 默认密码 taosdata 取 md5 为 dcc5bed04851fec854c035b2e40263b6
- auth: 原始密码取 32 位小写 md5
- `char *taos_get_server_info(TAOS *taos)`
......@@ -280,11 +280,11 @@ int taos_print_row(char *str, TAOS_ROW row, TAOS_FIELD *fields, int num_fields)
- `int taos_set_notify_cb(TAOS *taos, __taos_notify_fn_t fp, void *param, int type)`
设置事件通知回调函数。
设置事件回调函数。
- fp 事件通知回调函数指针。函数声明:typedef void (*__taos_notify_fn_t)(void *param, void *ext, int type);其中, param 为用户自定义参数,ext 为扩展参数(依赖事件通知类型,针对TAOS_NOTIFY_PASSVER 返回用户密码版本),type 为事件通知类型。
- param 用户自定义参数
- type 事件通知类型。取值:1)TAOS_NOTIFY_PASSVER: 用户密码改变。
- fp 事件回调函数指针。函数声明:typedef void (*__taos_notify_fn_t)(void *param, void *ext, int type);其中, param 为用户自定义参数,ext 为扩展参数(依赖事件类型,针对 TAOS_NOTIFY_PASSVER 返回用户密码版本),type 为事件类型
- param 用户自定义参数
- type 事件类型。取值范围:1)TAOS_NOTIFY_PASSVER: 用户密码改变
- `void taos_close(TAOS *taos)`
......@@ -463,11 +463,11 @@ TDengine 的异步 API 均采用非阻塞调用模式。应用程序可以用多
- `int taos_stmt_affected_rows(TAOS_STMT *stmt)`
获取被所执行的 SQL 语句影响的行数。
获取执行多次绑定语句影响的行数。
- `int taos_stmt_affected_rows_once(TAOS_STMT *stmt)`
获取被所执行的 SQL 语句影响的行数。
获取执行一次绑定语句影响的行数。
- `TAOS_RES* taos_stmt_use_result(TAOS_STMT *stmt)`
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册