From 7686f7cc44b2c1354f6843fa2474e71f3d72fc4a Mon Sep 17 00:00:00 2001 From: Jin Hai Date: Sun, 27 Oct 2024 20:09:11 +0800 Subject: [PATCH] Add more py APIs (#2108) ### What problem does this PR solve? - show database - show table - show index ### Type of change - [x] Documentation Update Signed-off-by: Jin Hai --- docs/references/pysdk_api_reference.md | 79 ++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/docs/references/pysdk_api_reference.md b/docs/references/pysdk_api_reference.md index 6a99d99e48..91955fdd51 100644 --- a/docs/references/pysdk_api_reference.md +++ b/docs/references/pysdk_api_reference.md @@ -288,6 +288,33 @@ res = infinity_object.list_databases() print(res.db_names) # ['my_database', 'database_1'] ``` + +--- + +## show_database + +```python +db_object.show_database(database_name) +``` + +Show detail information of a database. + +### Returns + +A structure containing the following attributes: + +- `error_code`: `int` + - `0`: The operation succeeds. + - A non-zero value indicates a specific error condition. +- `error_msg`: `str` + When `error_code` is non-zero, `error_msg` provides additional details about the error. + +### Examples + +```python +res = db_object.show_database('my_database') +``` + --- ## get_database @@ -767,6 +794,32 @@ res.table_names # ['my_table, 'tensor_table', 'sparse_table'] --- +## show_table + +```python +db_object.show_table(table_name) +``` + +Show detail information of a table. + +### Returns + +A structure containing the following attributes: + +- `error_code`: `int` + - `0`: The operation succeeds. + - A non-zero value indicates a specific error condition. +- `error_msg`: `str` + When `error_code` is non-zero, `error_msg` provides additional details about the error. + +### Examples + +```python +res = db_object.show_table('my_table') +``` + +--- + ## create_index ```python @@ -1120,6 +1173,32 @@ res.index_names # ['my_index', 'tensor_index', 'sparse_index'] --- +## show_index + +```python +db_object.show_index(index_name) +``` + +Show detail information of a index. + +### Returns + +A structure containing the following attributes: + +- `error_code`: `int` + - `0`: The operation succeeds. + - A non-zero value indicates a specific error condition. +- `error_msg`: `str` + When `error_code` is non-zero, `error_msg` provides additional details about the error. + +### Examples + +```python +res = table_object.show_index('my_index') +``` + +--- + ## insert ```python