This is a Meltano extension that provides a Microsoft SQL Server (MSSQL) state backend.
This package needs to be installed in the same Python environment as Meltano.
With uv
uv tool install --with git+https://github.com/meltano/meltano-state-backend-mssql.git meltanoWith pipx
pipx install meltano
pipx inject meltano git+https://github.com/meltano/meltano-state-backend-mssql.gitTo store state in MSSQL, set the state_backend.uri setting to an MSSQL connection URI:
mssql+pymssql://<user>:<password>@<host>:<port>/<database>
State will be stored in tables that Meltano will create automatically:
state— Stores the actual state datastate_lock— Used for distributed locking during state writes
To authenticate to MSSQL, you'll need to provide:
state_backend:
uri: mssql+pymssql://my_user:my_password@localhost:1433/my_database
mssql:
schema: meltano # Optional: defaults to meltano
table: state # Optional: defaults to stateAlternatively, you can provide credentials via individual settings:
state_backend:
uri: mssql+pymssql://localhost/my_database
mssql:
host: localhost
port: 1433 # Defaults to 1433 if not specified
user: my_user
password: my_password
database: my_database
schema: meltano # Optional: defaults to meltano
table: state # Optional: defaults to state- host: MSSQL server hostname (default: localhost)
- port: MSSQL server port (default: 1433)
- user: The username for authentication
- password: The password for authentication
- database: The database where state will be stored
- schema: The schema where state tables will be created (default:
meltano) - table: The table name for state storage (default:
state)
When storing credentials:
- Use environment variables for sensitive values in production
- Ensure the user has
CREATE TABLE,INSERT,UPDATE,DELETE, andSELECTprivileges on the schema
Example using environment variables:
export MELTANO_STATE_BACKEND_MSSQL_PASSWORD='my_secure_password'
meltano config set meltano state_backend.uri 'mssql+pymssql://my_user@localhost:1433/my_database'
meltano config set meltano state_backend.mssql.schema 'my_schema'uv syncRun lint, type checks, and tests for the current Python version:
uvx --with tox-uv --with tox-gh tox -e lint,types,3.13To run the full matrix (requires Python 3.10–3.13 installed locally):
uvx --with tox-uv --with tox-gh tox run-parallelUsing the GitHub CLI:
gh release create v<new-version>