Skip to main content

Microsoft SQL Server Python connector

The Python package exposes the manifest's query and execute operations through native python-tds sessions. Each attempt resolves the current private password, opens one SQL Server connection, pins session settings, and closes it. It never persists the password in Flow input, output, a receipt, or an Attribute.

Install and configure

Install dex-connector-microsoft-sql-server==0.1.0. Create a Dex Web connection named sqlserver-refunds for the runnable example, following the authorization guide in the connector README. The connection needs a host, database, SQL authentication user and secret password. Port, timeouts, row limits, and encryption have manifest defaults.

The Python package supports encrypt=mandatory with a verified server certificate from the system CA file, a bundled certifi CA fallback when Python exposes no system CA file, or SQLSERVER_SSL_CA on the Worker host. An explicitly configured CA path must exist. Hostname verification uses Subject Alternative Names, including DNS names and IP addresses; a Common Name alone is insufficient. encrypt=disable is allowed only for localhost, 127.0.0.1, or ::1. python-tds 1.17.1 has no public per-connection mode for TDS 8.0 strict encryption or for encryption without certificate validation. The Python package therefore rejects encrypt=strict and encrypt=trust-server-certificate during client construction, before any network connection. These modes remain supported by the Go connector. Choose the Go connector if either is required; do not change Python's setting to another mode without reviewing the server's TLS requirements.

python-tds converts SQL Server TIME, DATETIME2, and DATETIMEOFFSET values to Python's microsecond-resolution types. For a result column with scale 7, this package selects invalidResponse and names the column before emitting any row, because the seventh fractional digit would otherwise be lost. Use a SQL CAST to scale 6 or lower when microsecond precision is sufficient. Scales 0 through 6 retain their exact values. The package restores declared DECIMAL/NUMERIC scale and MONEY/SMALLMONEY's four decimal places after driver decoding. It returns serialized GEOGRAPHY, GEOMETRY, and HIERARCHYID values as base64 with their SQL type names. Unknown SQL types fail invalidResponse.

Operations

new_query_step runs a parameterized SELECT or WITH statement in a transaction. Closing its connection without COMMIT makes SQL Server roll it back. It returns completed with bounded rows, truncated when the row or JSON byte bound is reached, providerRejected for conclusive SQL Server errors, invalidResponse for undecodable values, and defect for invalid local input. Transient failures retry.

new_execute_step runs one parameterized INSERT, UPDATE, DELETE, MERGE, or WITH statement in its own transaction. The optional final @pN idempotency-key placeholder binds Dex's stable Call ID. A write that exceeds maxRowsAffected or an OUTPUT bound rolls back and selects limitExceeded. A failed COMMIT whose outcome is unknown selects uncertain; a COMMIT failure retries only when no bytes were sent. Failures before COMMIT retry only when safe. Make every write statement idempotent across retries and Worker replacement. rowsAffected sums all SQL Server DONE counts, including trigger statements. If the server supplies no count, maxRowsAffected fails invalidResponse before COMMIT. Receipts include the session process ID and server version; server errors add number, state, and severity. The connector enforces an attempt deadline and a response read budget in addition to the configured row and JSON response bounds. Exhausting the read budget returns truncated query rows or closes an execute session before COMMIT, causing SQL Server to roll it back.

Both operations accept @p1 through @pN positional parameters in SQL text. Do not interpolate user input into the statement. The connector checks for one allowed statement, rejects transaction control and other reserved operations, and binds values through python-tds named parameters. Python None binds as a SQL NULL literal, small integers bind as SQL INT, and timezone-aware datetime inputs are unsupported. Use explicit SQL casts when a parameter needs a specific SQL type. Read the runnable Flow for the exact application call pattern.

Verification

The package unit tests cover routing, driver error numbers, input validation, row bounds, and commit uncertainty. The example integration test runs its Worker and Client against a real dexcli dev server with scripted connector operations. The SQL Server service-container workflow runs tests/integration/test_database.py; its mandatory TLS pass depends on the separate CI workflow change in PR #518. No live SQL Server, Azure SQL Database, or Azure SQL Managed Instance has been verified through a user-controlled Dex Web connection for this Python package.

Metadata

Release files for dex-connector-microsoft-sql-server 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dex-connector-microsoft-sql-server 0.1.0
File Size Uploaded Provenance Actions
dex_connector_microsoft_sql_server-0.1.0.tar.gz 92.6 kB Without provenance Details for dex_connector_microsoft_sql_server-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dex-connector-microsoft-sql-server 0.1.0
File Interpreter ABI Platform Actions
dex_connector_microsoft_sql_server-0.1.0-py3-none-any.whl Python 3 none any Details for dex_connector_microsoft_sql_server-0.1.0-py3-none-any.whl

Total release size: 123.9 kB

Release files / dex_connector_microsoft_sql_server-0.1.0.tar.gz

Download URL dex_connector_microsoft_sql_server-0.1.0.tar.gz
Size 92.6 kB
Tags Source
SHA-256 checksum
How to use checksums
32903a8d71a5bd2de2e440cf187e68e1b4dc56954557886b4a356805dcc04166
BLAKE2b-256 checksum
How to use checksums
6e86563718f682735c98d8422e732b90deebe54a93a84bcfc3e058ae91a8e98f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / dex_connector_microsoft_sql_server-0.1.0-py3-none-any.whl

Download URL dex_connector_microsoft_sql_server-0.1.0-py3-none-any.whl
Size 31.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4df519818d2abd4503bbedaccdf02b000ebae9d4cd3fe47a376358e6b59bbcd2
BLAKE2b-256 checksum
How to use checksums
2d26648744f17faa74fbc9462a10a71345468adbd58c636480d701aac5bcd11e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for dex-connector-microsoft-sql-server 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page