Skip to content

Commit

Permalink
Fix pyodbc port mapping into server
Browse files Browse the repository at this point in the history
  • Loading branch information
tarsil committed Mar 28, 2023
1 parent f87e1b3 commit 3814528
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ jobs:
tests:
name: "Python ${{ matrix.python-version }}"
runs-on: "ubuntu-latest"
env:
MSSQL_SA_PASSWORD: Mssql123$#mssql

strategy:
matrix:
Expand Down Expand Up @@ -41,7 +43,7 @@ jobs:
mssql:
image: mcr.microsoft.com/mssql/server:2019-GA-ubuntu-16.04
env:
MSSQL_SA_PASSWORD: "Mssql123$#mssql"
MSSQL_SA_PASSWORD: ${{ env.MSSQL_SA_PASSWORD }}
ACCEPT_EULA: "Y"
MSSQL_PID: Express
ports:
Expand Down
2 changes: 1 addition & 1 deletion databases/backends/mssql.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ async def connect(self) -> None:
user = self._database_url.username or getpass.getuser()
password = self._database_url.password

dsn = f"Driver={driver};Database={database};Server={hostname};UID={user};PWD={password};Port={port}"
dsn = f"Driver={driver};Database={database};Server={hostname},{port};UID={user};PWD={password};"

self._pool = await aioodbc.create_pool(
dsn=dsn,
Expand Down

0 comments on commit 3814528

Please sign in to comment.