Skip to content

Commit

Permalink
[DOP-21415] Bring the JDBC connection names to the same format (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyasDevelopment authored Nov 15, 2024
1 parent 651f00c commit 3b3baa7
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 22 deletions.
6 changes: 3 additions & 3 deletions syncmaster/schemas/v1/connections/clickhouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand All @@ -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)


Expand All @@ -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)


Expand Down
6 changes: 3 additions & 3 deletions syncmaster/schemas/v1/connections/mssql.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand All @@ -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)


Expand All @@ -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)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"type": "mssql",
"host": "127.0.0.1",
"port": 1433,
"database": "name",
"database_name": "name",
},
{
"type": "mssql",
Expand Down Expand Up @@ -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",
Expand All @@ -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": {
Expand Down

0 comments on commit 3b3baa7

Please sign in to comment.