Skip to content

Commit af326ae

Browse files
feat(api): api update (#125)
1 parent 73e95d0 commit af326ae

File tree

7 files changed

+126
-9
lines changed

7 files changed

+126
-9
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 91
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-8db0b80dcaf777d02fd5720543576e1484e9dc93db7c1b50a11ee85c215f88b4.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-b2fe5c35562a5dafc33b2b5441a9e199668a03c7497b6d6350a2d25332dfecb0.yml

src/asktable/resources/datasources/datasources.py

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,20 @@ def with_streaming_response(self) -> DatasourcesResourceWithStreamingResponse:
9595
def create(
9696
self,
9797
*,
98-
engine: Literal["mysql", "tidb", "postgresql", "oceanbase", "clickhouse", "csv", "excel", "starrocks", "hive"],
98+
engine: Literal[
99+
"mysql",
100+
"tidb",
101+
"postgresql",
102+
"oceanbase",
103+
"clickhouse",
104+
"csv",
105+
"excel",
106+
"starrocks",
107+
"hive",
108+
"oracle",
109+
"polardbmysql",
110+
"polardbpg",
111+
],
99112
async_process_meta: bool | NotGiven = NOT_GIVEN,
100113
value_index: bool | NotGiven = NOT_GIVEN,
101114
access_config: Optional[datasource_create_params.AccessConfig] | NotGiven = NOT_GIVEN,
@@ -191,7 +204,20 @@ def update(
191204
access_config: Optional[datasource_update_params.AccessConfig] | NotGiven = NOT_GIVEN,
192205
desc: Optional[str] | NotGiven = NOT_GIVEN,
193206
engine: Optional[
194-
Literal["mysql", "tidb", "postgresql", "oceanbase", "clickhouse", "csv", "excel", "starrocks", "hive"]
207+
Literal[
208+
"mysql",
209+
"tidb",
210+
"postgresql",
211+
"oceanbase",
212+
"clickhouse",
213+
"csv",
214+
"excel",
215+
"starrocks",
216+
"hive",
217+
"oracle",
218+
"polardbmysql",
219+
"polardbpg",
220+
]
195221
]
196222
| NotGiven = NOT_GIVEN,
197223
field_count: Optional[int] | NotGiven = NOT_GIVEN,
@@ -529,7 +555,20 @@ def with_streaming_response(self) -> AsyncDatasourcesResourceWithStreamingRespon
529555
async def create(
530556
self,
531557
*,
532-
engine: Literal["mysql", "tidb", "postgresql", "oceanbase", "clickhouse", "csv", "excel", "starrocks", "hive"],
558+
engine: Literal[
559+
"mysql",
560+
"tidb",
561+
"postgresql",
562+
"oceanbase",
563+
"clickhouse",
564+
"csv",
565+
"excel",
566+
"starrocks",
567+
"hive",
568+
"oracle",
569+
"polardbmysql",
570+
"polardbpg",
571+
],
533572
async_process_meta: bool | NotGiven = NOT_GIVEN,
534573
value_index: bool | NotGiven = NOT_GIVEN,
535574
access_config: Optional[datasource_create_params.AccessConfig] | NotGiven = NOT_GIVEN,
@@ -625,7 +664,20 @@ async def update(
625664
access_config: Optional[datasource_update_params.AccessConfig] | NotGiven = NOT_GIVEN,
626665
desc: Optional[str] | NotGiven = NOT_GIVEN,
627666
engine: Optional[
628-
Literal["mysql", "tidb", "postgresql", "oceanbase", "clickhouse", "csv", "excel", "starrocks", "hive"]
667+
Literal[
668+
"mysql",
669+
"tidb",
670+
"postgresql",
671+
"oceanbase",
672+
"clickhouse",
673+
"csv",
674+
"excel",
675+
"starrocks",
676+
"hive",
677+
"oracle",
678+
"polardbmysql",
679+
"polardbpg",
680+
]
629681
]
630682
| NotGiven = NOT_GIVEN,
631683
field_count: Optional[int] | NotGiven = NOT_GIVEN,

src/asktable/types/datasource.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,20 @@ class Datasource(BaseModel):
1616
created_at: datetime
1717
"""创建时间"""
1818

19-
engine: Literal["mysql", "tidb", "postgresql", "oceanbase", "clickhouse", "csv", "excel", "starrocks", "hive"]
19+
engine: Literal[
20+
"mysql",
21+
"tidb",
22+
"postgresql",
23+
"oceanbase",
24+
"clickhouse",
25+
"csv",
26+
"excel",
27+
"starrocks",
28+
"hive",
29+
"oracle",
30+
"polardbmysql",
31+
"polardbpg",
32+
]
2033
"""数据源引擎"""
2134

2235
meta_status: Literal["processing", "failed", "success", "unprocessed"]

src/asktable/types/datasource_create_params.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,20 @@
1515

1616
class DatasourceCreateParams(TypedDict, total=False):
1717
engine: Required[
18-
Literal["mysql", "tidb", "postgresql", "oceanbase", "clickhouse", "csv", "excel", "starrocks", "hive"]
18+
Literal[
19+
"mysql",
20+
"tidb",
21+
"postgresql",
22+
"oceanbase",
23+
"clickhouse",
24+
"csv",
25+
"excel",
26+
"starrocks",
27+
"hive",
28+
"oracle",
29+
"polardbmysql",
30+
"polardbpg",
31+
]
1932
]
2033
"""数据源引擎"""
2134

@@ -40,6 +53,9 @@ class AccessConfigAccessConfigConnectionCreate(TypedDict, total=False):
4053
db_version: Optional[str]
4154
"""数据库版本"""
4255

56+
extra_config: Optional[object]
57+
"""额外配置"""
58+
4359
password: Optional[str]
4460
"""数据库密码"""
4561

src/asktable/types/datasource_retrieve_response.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ class AccessConfigAccessConfigConnectionResponse(BaseModel):
2727
db_version: Optional[str] = None
2828
"""数据库版本"""
2929

30+
extra_config: Optional[object] = None
31+
"""额外配置"""
32+
3033
port: Optional[int] = None
3134
"""数据库端口"""
3235

@@ -58,7 +61,20 @@ class DatasourceRetrieveResponse(BaseModel):
5861
created_at: datetime
5962
"""创建时间"""
6063

61-
engine: Literal["mysql", "tidb", "postgresql", "oceanbase", "clickhouse", "csv", "excel", "starrocks", "hive"]
64+
engine: Literal[
65+
"mysql",
66+
"tidb",
67+
"postgresql",
68+
"oceanbase",
69+
"clickhouse",
70+
"csv",
71+
"excel",
72+
"starrocks",
73+
"hive",
74+
"oracle",
75+
"polardbmysql",
76+
"polardbpg",
77+
]
6278
"""数据源引擎"""
6379

6480
meta_status: Literal["processing", "failed", "success", "unprocessed"]

src/asktable/types/datasource_update_params.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,20 @@ class DatasourceUpdateParams(TypedDict, total=False):
2121
"""数据源描述"""
2222

2323
engine: Optional[
24-
Literal["mysql", "tidb", "postgresql", "oceanbase", "clickhouse", "csv", "excel", "starrocks", "hive"]
24+
Literal[
25+
"mysql",
26+
"tidb",
27+
"postgresql",
28+
"oceanbase",
29+
"clickhouse",
30+
"csv",
31+
"excel",
32+
"starrocks",
33+
"hive",
34+
"oracle",
35+
"polardbmysql",
36+
"polardbpg",
37+
]
2538
]
2639
"""数据源引擎"""
2740

@@ -54,6 +67,9 @@ class AccessConfigAccessConfigConnectionUpdate(TypedDict, total=False):
5467
db_version: Optional[str]
5568
"""数据库版本"""
5669

70+
extra_config: Optional[object]
71+
"""额外配置"""
72+
5773
host: Optional[str]
5874
"""数据库地址"""
5975

tests/api_resources/test_datasources.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def test_method_create_with_all_params(self, client: Asktable) -> None:
3838
"host": "192.168.0.10",
3939
"db": "at_test",
4040
"db_version": "5.7",
41+
"extra_config": {"ssl_mode": "require"},
4142
"password": "root",
4243
"port": 3306,
4344
"securetunnel_id": "atst_123456",
@@ -123,6 +124,7 @@ def test_method_update_with_all_params(self, client: Asktable) -> None:
123124
access_config={
124125
"db": "at_test",
125126
"db_version": "5.7",
127+
"extra_config": {"ssl_mode": "require"},
126128
"host": "192.168.0.10",
127129
"password": "root",
128130
"port": 3306,
@@ -355,6 +357,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncAsktable)
355357
"host": "192.168.0.10",
356358
"db": "at_test",
357359
"db_version": "5.7",
360+
"extra_config": {"ssl_mode": "require"},
358361
"password": "root",
359362
"port": 3306,
360363
"securetunnel_id": "atst_123456",
@@ -440,6 +443,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncAsktable)
440443
access_config={
441444
"db": "at_test",
442445
"db_version": "5.7",
446+
"extra_config": {"ssl_mode": "require"},
443447
"host": "192.168.0.10",
444448
"password": "root",
445449
"port": 3306,

0 commit comments

Comments
 (0)