diff --git a/syncmaster/schemas/v1/connections/clickhouse.py b/syncmaster/schemas/v1/connections/clickhouse.py index b4cf7320..85de9009 100644 --- a/syncmaster/schemas/v1/connections/clickhouse.py +++ b/syncmaster/schemas/v1/connections/clickhouse.py @@ -15,7 +15,7 @@ class Config: class ReadClickhouseConnectionSchema(ClickhouseBaseSchema): host: str port: int - database: str | None = None + database_name: str | None = None additional_params: dict = Field(default_factory=dict) @@ -26,7 +26,7 @@ class ReadClickhouseAuthSchema(ClickhouseBaseSchema): class UpdateClickhouseConnectionSchema(ClickhouseBaseSchema): host: str | None = None port: int | None = None - database: str | None = None + database_name: str | None = None additional_params: dict | None = Field(default_factory=dict) @@ -38,7 +38,7 @@ class UpdateClickhouseAuthSchema(ClickhouseBaseSchema): class CreateClickhouseConnectionSchema(ClickhouseBaseSchema): host: str port: int - database: str | None = None + database_name: str | None = None additional_params: dict = Field(default_factory=dict) diff --git a/syncmaster/schemas/v1/connections/mssql.py b/syncmaster/schemas/v1/connections/mssql.py index b560bd00..69aca3c1 100644 --- a/syncmaster/schemas/v1/connections/mssql.py +++ b/syncmaster/schemas/v1/connections/mssql.py @@ -15,7 +15,7 @@ class Config: class ReadMSSQLConnectionSchema(MSSQLBaseSchema): host: str port: int - database: str + database_name: str additional_params: dict = Field(default_factory=dict) @@ -26,7 +26,7 @@ class ReadMSSQLAuthSchema(MSSQLBaseSchema): class UpdateMSSQLConnectionSchema(MSSQLBaseSchema): host: str | None = None port: int | None = None - database: str | None = None + database_name: str | None = None additional_params: dict | None = Field(default_factory=dict) @@ -38,7 +38,7 @@ class UpdateMSSQLAuthSchema(MSSQLBaseSchema): class CreateMSSQLConnectionSchema(MSSQLBaseSchema): host: str port: int - database: str + database_name: str additional_params: dict = Field(default_factory=dict) diff --git a/tests/test_unit/test_connections/connection_fixtures/group_connections_fixture.py b/tests/test_unit/test_connections/connection_fixtures/group_connections_fixture.py index a679d89c..3c599207 100644 --- a/tests/test_unit/test_connections/connection_fixtures/group_connections_fixture.py +++ b/tests/test_unit/test_connections/connection_fixtures/group_connections_fixture.py @@ -39,18 +39,18 @@ async def group_connections( "bucket": "bucket", }, ) - elif conn_type in [ConnectionType.POSTGRES, ConnectionType.MYSQL]: + elif conn_type in [ + ConnectionType.POSTGRES, + ConnectionType.ORACLE, + ConnectionType.CLICKHOUSE, + ConnectionType.MSSQL, + ConnectionType.MYSQL, + ]: new_data.update( { "database_name": "database", }, ) - elif conn_type in [ConnectionType.ORACLE, ConnectionType.CLICKHOUSE, ConnectionType.MSSQL]: - new_data.update( - { - "database": "database", - }, - ) new_connection = Connection( group_id=connection.group_id, diff --git a/tests/test_unit/test_connections/test_db_connection/test_create_clickhouse_connection.py b/tests/test_unit/test_connections/test_db_connection/test_create_clickhouse_connection.py index f87996df..28877d2a 100644 --- a/tests/test_unit/test_connections/test_db_connection/test_create_clickhouse_connection.py +++ b/tests/test_unit/test_connections/test_db_connection/test_create_clickhouse_connection.py @@ -33,7 +33,7 @@ async def test_developer_plus_can_create_clickhouse_connection( "type": "clickhouse", "host": "127.0.0.1", "port": 8123, - "database": "database_name", + "database_name": "database", }, "auth_data": { "type": "clickhouse", @@ -70,7 +70,7 @@ async def test_developer_plus_can_create_clickhouse_connection( "type": connection.data["type"], "host": connection.data["host"], "port": connection.data["port"], - "database": connection.data["database"], + "database_name": connection.data["database_name"], "additional_params": connection.data["additional_params"], }, "auth_data": { diff --git a/tests/test_unit/test_connections/test_db_connection/test_create_mssql_connection.py b/tests/test_unit/test_connections/test_db_connection/test_create_mssql_connection.py index b04ec3f7..fc51def0 100644 --- a/tests/test_unit/test_connections/test_db_connection/test_create_mssql_connection.py +++ b/tests/test_unit/test_connections/test_db_connection/test_create_mssql_connection.py @@ -33,7 +33,7 @@ async def test_developer_plus_can_create_mssql_connection( "type": "mssql", "host": "127.0.0.1", "port": 1433, - "database": "database_name", + "database_name": "database", }, "auth_data": { "type": "mssql", @@ -70,7 +70,7 @@ async def test_developer_plus_can_create_mssql_connection( "type": connection.data["type"], "host": connection.data["host"], "port": connection.data["port"], - "database": connection.data["database"], + "database_name": connection.data["database_name"], "additional_params": connection.data["additional_params"], }, "auth_data": { diff --git a/tests/test_unit/test_connections/test_db_connection/test_update_clickhouse_connection.py b/tests/test_unit/test_connections/test_db_connection/test_update_clickhouse_connection.py index 41118110..59199555 100644 --- a/tests/test_unit/test_connections/test_db_connection/test_update_clickhouse_connection.py +++ b/tests/test_unit/test_connections/test_db_connection/test_update_clickhouse_connection.py @@ -41,7 +41,7 @@ async def test_developer_plus_can_update_clickhouse_connection( "connection_data": { "type": "clickhouse", "host": "127.0.1.1", - "database": "new_name", + "database_name": "new_name", }, "auth_data": { "type": "clickhouse", @@ -61,7 +61,7 @@ async def test_developer_plus_can_update_clickhouse_connection( "type": group_connection.data["type"], "host": "127.0.1.1", "port": group_connection.data["port"], - "database": "new_name", + "database_name": "new_name", "additional_params": {}, }, "auth_data": { diff --git a/tests/test_unit/test_connections/test_db_connection/test_update_mssql_connection.py b/tests/test_unit/test_connections/test_db_connection/test_update_mssql_connection.py index f2942ad8..fc5242f8 100644 --- a/tests/test_unit/test_connections/test_db_connection/test_update_mssql_connection.py +++ b/tests/test_unit/test_connections/test_db_connection/test_update_mssql_connection.py @@ -14,7 +14,7 @@ "type": "mssql", "host": "127.0.0.1", "port": 1433, - "database": "name", + "database_name": "name", }, { "type": "mssql", @@ -42,7 +42,7 @@ async def test_developer_plus_can_update_mssql_connection( "connection_data": { "type": "mssql", "host": "127.0.1.1", - "database": "new_name", + "database_name": "new_name", }, "auth_data": { "type": "mssql", @@ -62,7 +62,7 @@ async def test_developer_plus_can_update_mssql_connection( "type": group_connection.data["type"], "host": "127.0.1.1", "port": group_connection.data["port"], - "database": "new_name", + "database_name": "new_name", "additional_params": {}, }, "auth_data": {