Skip to content

Commit

Permalink
Add more py APIs (#2108)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?

- show database
- show table
- show index

### Type of change

- [x] Documentation Update

Signed-off-by: Jin Hai <[email protected]>
  • Loading branch information
JinHai-CN authored Oct 27, 2024
1 parent ef03d3e commit 7686f7c
Showing 1 changed file with 79 additions and 0 deletions.
79 changes: 79 additions & 0 deletions docs/references/pysdk_api_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7686f7c

Please sign in to comment.