Skip to main content

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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sqlrules_mssql-1.0.1-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

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

Hashes for sqlrules_mssql-1.0.1.tar.gz
Algorithm Hash digest
SHA256 29d6b09c2512c6e9734c8a039e8b864541c07dab27f9f3f98b96c5db7f00e0ff
MD5 d8a39a9f211a8dcfbf240ee3d49a975e
BLAKE2b-256 0649b0814226bc14d0ca5e9e4715f57587a687ecec33b64f11d562201b2744b6

See more details on using hashes here.

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

Hashes for sqlrules_mssql-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 858506e9f0583daf2d0a71cb0140d43c42a54ef1916669084aea9dbe44b92532
MD5 d4978dfe4e25e2dafa630c1d530b5696
BLAKE2b-256 8e1514c33909a9b21254cd9ffc24af51afe0cd14ed5c9f1f809b3215b001420e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page