Open
Description
Given a config.py
like...
from sqlmesh.core.config import (
Config,
GatewayConfig,
MSSQLConnectionConfig
)
config = Config(
gateways={
"local": GatewayConfig(
connection=MSSQLConnectionConfig(
host='localhost',
user='sa',
password='placeholder',
database='db',
),
),
},
)
Attempting to override the password using
export SQLMESH__GATEWAYS__LOCAL__CONNECTION__PASSWORD=real_pw
as shown in https://sqlmesh.readthedocs.io/en/stable/guides/configuration/?h=override#overrides
fails with the error
Error: Missing connection type.
when running a command like sqlmesh --gateway local info
Exporting the whole set of environment variables for the local gateway connection, including SQLMESH__GATEWAYS__LOCAL__CONNECTION__TYPE
allows the sqlmesh CLI to run as expected.
When the same config is given as config.yaml
instead...
gateways:
local:
connection:
type: mssql
host: localhost
user: sa
password: placeholder
database: db
...the override works as expected with only the single environment variable SQLMESH__GATEWAYS__LOCAL__CONNECTION__PASSWORD
set.