Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 91
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-8db0b80dcaf777d02fd5720543576e1484e9dc93db7c1b50a11ee85c215f88b4.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/datamini%2Fasktable-b2fe5c35562a5dafc33b2b5441a9e199668a03c7497b6d6350a2d25332dfecb0.yml
60 changes: 56 additions & 4 deletions src/asktable/resources/datasources/datasources.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,20 @@ def with_streaming_response(self) -> DatasourcesResourceWithStreamingResponse:
def create(
self,
*,
engine: Literal["mysql", "tidb", "postgresql", "oceanbase", "clickhouse", "csv", "excel", "starrocks", "hive"],
engine: Literal[
"mysql",
"tidb",
"postgresql",
"oceanbase",
"clickhouse",
"csv",
"excel",
"starrocks",
"hive",
"oracle",
"polardbmysql",
"polardbpg",
],
async_process_meta: bool | NotGiven = NOT_GIVEN,
value_index: bool | NotGiven = NOT_GIVEN,
access_config: Optional[datasource_create_params.AccessConfig] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -191,7 +204,20 @@ def update(
access_config: Optional[datasource_update_params.AccessConfig] | NotGiven = NOT_GIVEN,
desc: Optional[str] | NotGiven = NOT_GIVEN,
engine: Optional[
Literal["mysql", "tidb", "postgresql", "oceanbase", "clickhouse", "csv", "excel", "starrocks", "hive"]
Literal[
"mysql",
"tidb",
"postgresql",
"oceanbase",
"clickhouse",
"csv",
"excel",
"starrocks",
"hive",
"oracle",
"polardbmysql",
"polardbpg",
]
]
| NotGiven = NOT_GIVEN,
field_count: Optional[int] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -461,7 +487,20 @@ def with_streaming_response(self) -> AsyncDatasourcesResourceWithStreamingRespon
async def create(
self,
*,
engine: Literal["mysql", "tidb", "postgresql", "oceanbase", "clickhouse", "csv", "excel", "starrocks", "hive"],
engine: Literal[
"mysql",
"tidb",
"postgresql",
"oceanbase",
"clickhouse",
"csv",
"excel",
"starrocks",
"hive",
"oracle",
"polardbmysql",
"polardbpg",
],
async_process_meta: bool | NotGiven = NOT_GIVEN,
value_index: bool | NotGiven = NOT_GIVEN,
access_config: Optional[datasource_create_params.AccessConfig] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -557,7 +596,20 @@ async def update(
access_config: Optional[datasource_update_params.AccessConfig] | NotGiven = NOT_GIVEN,
desc: Optional[str] | NotGiven = NOT_GIVEN,
engine: Optional[
Literal["mysql", "tidb", "postgresql", "oceanbase", "clickhouse", "csv", "excel", "starrocks", "hive"]
Literal[
"mysql",
"tidb",
"postgresql",
"oceanbase",
"clickhouse",
"csv",
"excel",
"starrocks",
"hive",
"oracle",
"polardbmysql",
"polardbpg",
]
]
| NotGiven = NOT_GIVEN,
field_count: Optional[int] | NotGiven = NOT_GIVEN,
Expand Down
15 changes: 14 additions & 1 deletion src/asktable/types/datasource.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,20 @@ class Datasource(BaseModel):
created_at: datetime
"""创建时间"""

engine: Literal["mysql", "tidb", "postgresql", "oceanbase", "clickhouse", "csv", "excel", "starrocks", "hive"]
engine: Literal[
"mysql",
"tidb",
"postgresql",
"oceanbase",
"clickhouse",
"csv",
"excel",
"starrocks",
"hive",
"oracle",
"polardbmysql",
"polardbpg",
]
"""数据源引擎"""

meta_status: Literal["processing", "failed", "success", "unprocessed"]
Expand Down
18 changes: 17 additions & 1 deletion src/asktable/types/datasource_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,20 @@

class DatasourceCreateParams(TypedDict, total=False):
engine: Required[
Literal["mysql", "tidb", "postgresql", "oceanbase", "clickhouse", "csv", "excel", "starrocks", "hive"]
Literal[
"mysql",
"tidb",
"postgresql",
"oceanbase",
"clickhouse",
"csv",
"excel",
"starrocks",
"hive",
"oracle",
"polardbmysql",
"polardbpg",
]
]
"""数据源引擎"""

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

extra_config: Optional[object]
"""额外配置"""

password: Optional[str]
"""数据库密码"""

Expand Down
18 changes: 17 additions & 1 deletion src/asktable/types/datasource_retrieve_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ class AccessConfigAccessConfigConnectionResponse(BaseModel):
db_version: Optional[str] = None
"""数据库版本"""

extra_config: Optional[object] = None
"""额外配置"""

port: Optional[int] = None
"""数据库端口"""

Expand Down Expand Up @@ -58,7 +61,20 @@ class DatasourceRetrieveResponse(BaseModel):
created_at: datetime
"""创建时间"""

engine: Literal["mysql", "tidb", "postgresql", "oceanbase", "clickhouse", "csv", "excel", "starrocks", "hive"]
engine: Literal[
"mysql",
"tidb",
"postgresql",
"oceanbase",
"clickhouse",
"csv",
"excel",
"starrocks",
"hive",
"oracle",
"polardbmysql",
"polardbpg",
]
"""数据源引擎"""

meta_status: Literal["processing", "failed", "success", "unprocessed"]
Expand Down
18 changes: 17 additions & 1 deletion src/asktable/types/datasource_update_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,20 @@ class DatasourceUpdateParams(TypedDict, total=False):
"""数据源描述"""

engine: Optional[
Literal["mysql", "tidb", "postgresql", "oceanbase", "clickhouse", "csv", "excel", "starrocks", "hive"]
Literal[
"mysql",
"tidb",
"postgresql",
"oceanbase",
"clickhouse",
"csv",
"excel",
"starrocks",
"hive",
"oracle",
"polardbmysql",
"polardbpg",
]
]
"""数据源引擎"""

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

extra_config: Optional[object]
"""额外配置"""

host: Optional[str]
"""数据库地址"""

Expand Down
4 changes: 4 additions & 0 deletions tests/api_resources/test_datasources.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def test_method_create_with_all_params(self, client: Asktable) -> None:
"host": "192.168.0.10",
"db": "at_test",
"db_version": "5.7",
"extra_config": {"ssl_mode": "require"},
"password": "root",
"port": 3306,
"securetunnel_id": "atst_123456",
Expand Down Expand Up @@ -123,6 +124,7 @@ def test_method_update_with_all_params(self, client: Asktable) -> None:
access_config={
"db": "at_test",
"db_version": "5.7",
"extra_config": {"ssl_mode": "require"},
"host": "192.168.0.10",
"password": "root",
"port": 3306,
Expand Down Expand Up @@ -355,6 +357,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncAsktable)
"host": "192.168.0.10",
"db": "at_test",
"db_version": "5.7",
"extra_config": {"ssl_mode": "require"},
"password": "root",
"port": 3306,
"securetunnel_id": "atst_123456",
Expand Down Expand Up @@ -440,6 +443,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncAsktable)
access_config={
"db": "at_test",
"db_version": "5.7",
"extra_config": {"ssl_mode": "require"},
"host": "192.168.0.10",
"password": "root",
"port": 3306,
Expand Down