sqlrules-mssql
SQL Server backend provider for SQLRules. The package version follows the core 2.x line.
Install
pip install "sqlrules>=2,<3" "sqlrules-mssql>=2,<3"
Use
from typing import Annotated, Any
from pydantic import Field
from sqlalchemy import Column, MetaData, String, Table
from sqlrules import Compiler, JsonContains, JsonHasKey, RuleSchema, where
from sqlrules_mssql import MssqlPlugin
rows = Table(
"rows",
MetaData(),
Column("name", String),
Column("meta", String), # SQL Server stores JSON documents in text columns.
)
class RowRules(RuleSchema):
name: Annotated[str, Field(min_length=2, max_length=40)]
meta: Annotated[dict[str, Any], JsonContains({"active": True}), JsonHasKey("active")]
provider = MssqlPlugin(server_version=(16, 0), compatibility_level=160)
compiled = Compiler(plugins=[provider]).compile(RowRules, rows)
statement = rows.select().where(*where(compiled))
Capabilities
- SQL Server
LENlength constraints - Guarded JSON helpers for text columns validated with
ISJSON(server_version>= 13 and explicitcompatibility_level>= 130) JsonContainssupports null, boolean, and string values; nested objects and arrays compare structurally, while numeric JSON values raiseCapabilityErrorbecause exact numeric equality cannot be guaranteed fromOPENJSONtext values- Safe lax text-to-int/float conversions on SQL Server 2012+
- No built-in regex translator
- Text-to-Decimal is a compile-time capability error
String Literal and Enum fields require an explicit binary or case-sensitive collation. See the type support matrix.
Metadata
Release files for sqlrules-mssql 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sqlrules_mssql-2.0.0.tar.gz | 7.2 kB | Without provenance | Details for sqlrules_mssql-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sqlrules_mssql-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for sqlrules_mssql-2.0.0-py3-none-any.whl |
Total release size: 15.2 kB
Release files / sqlrules_mssql-2.0.0.tar.gz
| Download URL | sqlrules_mssql-2.0.0.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a60806c5990f4bdc4423dc58ababc1d9ab5bd2c3ac02b46a467e8eb7b24280bd
|
|
BLAKE2b-256 checksum How to use checksums |
9fc8c4c9e5e0a0566eef9be10a10d05d78e0f9f92a25626bd097d367195ae25f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / sqlrules_mssql-2.0.0-py3-none-any.whl
| Download URL | sqlrules_mssql-2.0.0-py3-none-any.whl |
|---|---|
| Size | 8.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
332635c660b9a45f4ab7bb1883c700d5da0c036687a5d65f0cf2294ab03d43b0
|
|
BLAKE2b-256 checksum How to use checksums |
2187268f555e7d62f982717db97c8240f40ae35e81a27ae3080323f01eb633db
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Security for sqlrules-mssql 2.0.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.