SQL Server dialect plugin for SQLRules (JSON and LEN string ops).
Project description
sqlrules-mssql
SQL Server dialect plugin for SQLRules.
Install
pip install sqlrules-mssql
Usage
from typing import Annotated, Any
from pydantic import BaseModel, Field
from sqlrules import Compiler, JsonContains, JsonHasKey
from sqlrules_mssql import MssqlPlugin
class RowFilter(BaseModel):
name: Annotated[str, Field(min_length=2, max_length=40)]
meta: Annotated[dict[str, Any], JsonContains({"active": True}), JsonHasKey("active")]
compiler = Compiler(plugins=[MssqlPlugin()], dialect="mssql")
Operators
| IR operator | Notes |
|---|---|
min_length / max_length |
LEN(column) instead of portable length() |
type_check |
Limited shape checks (typed columns; LIKE for some String forms) |
json_contains |
Shallow JSON_VALUE / JSON_QUERY checks |
json_has_key |
JSON_VALUE / JSON_QUERY IS NOT NULL |
pattern is intentionally not registered — prefer a custom translator over
guessing LIKE semantics.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sqlrules_mssql-1.0.1.tar.gz
(6.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sqlrules_mssql-1.0.1.tar.gz.
File metadata
- Download URL: sqlrules_mssql-1.0.1.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29d6b09c2512c6e9734c8a039e8b864541c07dab27f9f3f98b96c5db7f00e0ff
|
|
| MD5 |
d8a39a9f211a8dcfbf240ee3d49a975e
|
|
| BLAKE2b-256 |
0649b0814226bc14d0ca5e9e4715f57587a687ecec33b64f11d562201b2744b6
|
File details
Details for the file sqlrules_mssql-1.0.1-py3-none-any.whl.
File metadata
- Download URL: sqlrules_mssql-1.0.1-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
858506e9f0583daf2d0a71cb0140d43c42a54ef1916669084aea9dbe44b92532
|
|
| MD5 |
d4978dfe4e25e2dafa630c1d530b5696
|
|
| BLAKE2b-256 |
8e1514c33909a9b21254cd9ffc24af51afe0cd14ed5c9f1f809b3215b001420e
|