Metadata-Version: 2.4
Name: sqlrules-mssql
Version: 1.0.0
Summary: SQL Server dialect plugin for SQLRules (JSON and LEN string ops).
Project-URL: Homepage, https://github.com/eddiethedean/sqlrules
Project-URL: Repository, https://github.com/eddiethedean/sqlrules
Project-URL: Issues, https://github.com/eddiethedean/sqlrules/issues
Author: SQLRules Contributors
License-Expression: MIT
License-File: LICENSE
Keywords: mssql,pydantic,sqlalchemy,sqlrules,sqlserver
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: sqlalchemy<3,>=2.0
Requires-Dist: sqlrules<2,>=1
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == 'dev'
Description-Content-Type: text/markdown

# sqlrules-mssql

SQL Server dialect plugin for [SQLRules](https://github.com/eddiethedean/sqlrules).

## Install

```bash
pip install sqlrules-mssql
```

## Usage

```python
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.
