Skip to content

Commit 16ff411

Browse files
authored
Make user and pw fields optional for MSSQL connection (#2262)
1 parent e1c69d0 commit 16ff411

2 files changed

Lines changed: 16 additions & 16 deletions

File tree

docs/integrations/engines/mssql.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ pip install "sqlmesh[mssql]"
1010

1111
### Connection options
1212

13-
| Option | Description | Type | Required |
14-
|-------------------|--------------------------------------------------------------|:--------:|:--------:|
15-
| `type` | Engine type name - must be `mssql` | string | Y |
16-
| `host` | The hostname of the MSSQL server | string | Y |
17-
| `user` | The username to use for authentication with the MSSQL server | string | Y |
18-
| `password` | The password to use for authentication with the MSSQL server | string | Y |
19-
| `port` | The port number of the MSSQL server | int | N |
20-
| `database` | The target database | string | N |
21-
| `charset` | The character set used for the connection | string | N |
22-
| `timeout` | The query timeout in seconds. Default: no timeout | int | N |
23-
| `login_timeout` | The timeout for connection and login in seconds. Default: 60 | int | N |
24-
| `appname` | The application name to use for the connection | string | N |
25-
| `conn_properties` | The list of connection properties | [string] | N |
26-
| `autocommit` | Is autocommit mode enabled. Default: false | bool | N |
13+
| Option | Description | Type | Required |
14+
| ----------------- | ------------------------------------------------------------ | :----------: | :------: |
15+
| `type` | Engine type name - must be `mssql` | string | Y |
16+
| `host` | The hostname of the MSSQL server | string | Y |
17+
| `user` | The username to use for authentication with the MSSQL server | string | N |
18+
| `password` | The password to use for authentication with the MSSQL server | string | N |
19+
| `port` | The port number of the MSSQL server | int | N |
20+
| `database` | The target database | string | N |
21+
| `charset` | The character set used for the connection | string | N |
22+
| `timeout` | The query timeout in seconds. Default: no timeout | int | N |
23+
| `login_timeout` | The timeout for connection and login in seconds. Default: 60 | int | N |
24+
| `appname` | The application name to use for the connection | string | N |
25+
| `conn_properties` | The list of connection properties | list[string] | N |
26+
| `autocommit` | Is autocommit mode enabled. Default: false | bool | N |

sqlmesh/core/config/connection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -964,8 +964,8 @@ def _connection_factory(self) -> t.Callable:
964964

965965
class MSSQLConnectionConfig(ConnectionConfig):
966966
host: str
967-
user: str
968-
password: str
967+
user: t.Optional[str] = None
968+
password: t.Optional[str] = None
969969
database: t.Optional[str] = ""
970970
timeout: t.Optional[int] = 0
971971
login_timeout: t.Optional[int] = 60

0 commit comments

Comments
 (0)