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.0.tar.gz (6.2 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.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

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

Hashes for sqlrules_mssql-1.0.0.tar.gz
Algorithm Hash digest
SHA256 678705ae755aea5fb6e746a8d4c34e81ec61253b0c15d39552603a1a574b50c3
MD5 3866abb33b76cd8d5700bf44fd236557
BLAKE2b-256 0dbfe92be280fe304d9e814abb4e06202a1c45336ea67cef1496732e3eeca06b

See more details on using hashes here.

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

Hashes for sqlrules_mssql-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3ddd05bd1b707f6517c680f1b52aa678262ca0b31b0f274f100344fc9b83eea8
MD5 31438823e886425d7f744cf3ef968da2
BLAKE2b-256 c9b533ac13ade98da2ee377b831ba0db0401641812d55ca16334a5bd984dd5c0

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