Alias 操作
更新时间:2024-02-04
设置别名
功能介绍
给Table设置别名
请求示例
Python
1import pymochow
2from pymochow.configuration import Configuration
3from pymochow.auth.bce_credentials import BceCredentials
4
5account = 'root'
6api_key = 'your_api_key'
7endpoint = 'you_endpoint' #example http://127.0.0.1:8511
8
9config = Configuration(credentials=BceCredentials(account, api_key),
10 endpoint=endpoint)
11client = pymochow.MochowClient(config)
12
13db = client.database("db_test")
14table = db.table("book_vector")
15table.alias("alias_book_vector")
16
17client.close()
请求参数
| 参数 | 是否必选 | 参数含义 |
|---|---|---|
| alias | 是 | 表的别名 |
删除别名
功能介绍
删除Table别名
请求示例
Python
1import pymochow
2from pymochow.configuration import Configuration
3from pymochow.auth.bce_credentials import BceCredentials
4
5account = 'root'
6api_key = 'your_api_key'
7endpoint = 'you_endpoint' #example http://127.0.0.1:8511
8
9config = Configuration(credentials=BceCredentials(account, api_key),
10 endpoint=endpoint)
11client = pymochow.MochowClient(config)
12
13db = client.database("db_test")
14table = db.table("book_vector")
15table.unalias("alias_book_vector")
16
17client.close()
请求参数
| 参数 | 是否必选 | 参数含义 |
|---|---|---|
| alias | 是 | 表的别名 |
