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.0.tar.gz
(6.2 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.0.tar.gz.
File metadata
- Download URL: sqlrules_mssql-1.0.0.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
678705ae755aea5fb6e746a8d4c34e81ec61253b0c15d39552603a1a574b50c3
|
|
| MD5 |
3866abb33b76cd8d5700bf44fd236557
|
|
| BLAKE2b-256 |
0dbfe92be280fe304d9e814abb4e06202a1c45336ea67cef1496732e3eeca06b
|
File details
Details for the file sqlrules_mssql-1.0.0-py3-none-any.whl.
File metadata
- Download URL: sqlrules_mssql-1.0.0-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 |
3ddd05bd1b707f6517c680f1b52aa678262ca0b31b0f274f100344fc9b83eea8
|
|
| MD5 |
31438823e886425d7f744cf3ef968da2
|
|
| BLAKE2b-256 |
c9b533ac13ade98da2ee377b831ba0db0401641812d55ca16334a5bd984dd5c0
|