Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
014b4fc
feat: implement SQLRules 2.0 release phase
eddiethedean Sep 25, 2026
4515de6
fix: align phase 2.0 CI checks
eddiethedean Sep 25, 2026
41a3ec8
docs: format v2 design example for CI
eddiethedean Sep 25, 2026
44056b4
fix: totalize predicates for SQL Server
eddiethedean Sep 25, 2026
dd2db6b
fix: handle constant predicates and full-text fixtures
eddiethedean Sep 25, 2026
c9e5cc8
test: use a unique MySQL full-text term
eddiethedean Sep 25, 2026
6cfcc13
test: require a MySQL full-text query term
eddiethedean Sep 25, 2026
7973b12
test: commit rows before MySQL full-text search
eddiethedean Sep 25, 2026
5e7955d
fix: address phase 2.0 review findings
eddiethedean Sep 25, 2026
d1eca0d
style: format conversion report message
eddiethedean Sep 25, 2026
1920c9e
fix: let plugins replace multiple_of float handling
eddiethedean Sep 25, 2026
c6cd138
Fix SQLRules 2.0 backend conformance gaps
eddiethedean Sep 25, 2026
696b133
fix: address full PR review findings
eddiethedean Sep 25, 2026
c17794f
fix: address remaining PR review findings
eddiethedean Sep 26, 2026
a4097a4
Fix PR review findings
eddiethedean Sep 26, 2026
100c7b1
Type SQL Server JSON root checks
eddiethedean Sep 26, 2026
777e9d6
Format review fix changes
eddiethedean Sep 26, 2026
e54b4ca
Guard JSON key rules against array roots
eddiethedean Sep 26, 2026
d5d1604
Compare SQL Server JSON keys exactly
eddiethedean Sep 26, 2026
524a35f
Reject JsonHasKey on list rules
eddiethedean Sep 26, 2026
9edf2ca
Fix SQLRules 2.0 review findings
eddiethedean Sep 26, 2026
cf43a96
Allow array markers on list rules
eddiethedean Sep 26, 2026
79aaa07
Fix SQLRules 2.0 PR review issues
eddiethedean Sep 26, 2026
fa25602
Correct backend regression test assumptions
eddiethedean Sep 26, 2026
b2d32bb
Fix remaining SQLRules 2.0 review issues
eddiethedean Sep 26, 2026
0601def
Fix SQLite integer whitespace coercion
eddiethedean Sep 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 79 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
python -m pip install "pydantic==2.13.4"
python -m pip install -e packages/sqlrules-postgresql -e packages/sqlrules-sqlite \
-e packages/sqlrules-mysql -e packages/sqlrules-mssql

Expand Down Expand Up @@ -66,6 +67,7 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
python -m pip install "pydantic==2.13.4"
python -m pip install -e packages/sqlrules-postgresql -e packages/sqlrules-sqlite \
-e packages/sqlrules-mysql -e packages/sqlrules-mssql

Expand Down Expand Up @@ -113,39 +115,26 @@ jobs:
python - <<'PY'
from typing import Annotated

from pydantic import BaseModel, Field
from pydantic import Field
from sqlalchemy import Column, MetaData, String, Table

import sqlrules
from sqlrules import (
compile,
where,
flatten,
Compiler,
PLUGIN_API_VERSION,
clear_model_cache,
pattern_text,
TranslatorRegistry,
default_registry,
)
from sqlrules import PLUGIN_API_VERSION, RuleSchema, pattern_text
from sqlrules.conformance import run_basic_conformance
from sqlrules_postgresql import PostgresPlugin
from sqlrules_sqlite import SQLitePlugin
from sqlrules_mysql import MysqlPlugin
from sqlrules_mssql import MssqlPlugin

assert sqlrules.__version__
assert callable(compile)
assert callable(where)
assert callable(flatten)
assert callable(clear_model_cache)
assert callable(sqlrules.compile)
assert callable(sqlrules.where)
assert callable(sqlrules.flatten)
assert callable(sqlrules.notwhere)
assert callable(pattern_text)
assert Compiler is not None
assert TranslatorRegistry is not None
assert callable(default_registry)
assert PLUGIN_API_VERSION == "1"
assert PLUGIN_API_VERSION == "2"

class LengthFilter(BaseModel):
class LengthFilter(RuleSchema):
name: Annotated[str, Field(min_length=2)]

length_table = Table("items", MetaData(), Column("name", String))
Expand Down Expand Up @@ -178,6 +167,72 @@ jobs:
- name: Sphinx
run: sphinx-build -W -b html docs docs/_build/html

database-conformance:
name: Live database conformance
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: sqlrules
POSTGRES_PASSWORD: sqlrules-ci
POSTGRES_DB: sqlrules
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U sqlrules -d sqlrules"
--health-interval 10s
--health-timeout 5s
--health-retries 10
mysql:
image: mysql:8.0
env:
MYSQL_DATABASE: sqlrules
MYSQL_USER: sqlrules
MYSQL_PASSWORD: sqlrules-ci
MYSQL_ROOT_PASSWORD: root-ci
ports:
- 3306:3306
options: >-
--health-cmd "mysqladmin ping -h 127.0.0.1 -uroot -proot-ci"
--health-interval 10s
--health-timeout 5s
--health-retries 20
mssql:
image: mcr.microsoft.com/mssql/server:2022-latest
env:
ACCEPT_EULA: "Y"
MSSQL_SA_PASSWORD: "SqlRules-ci!Passw0rd"
ports:
- 1433:1433
options: >-
--health-cmd "/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P 'SqlRules-ci!Passw0rd' -C -Q 'SELECT 1' || exit 1"
--health-interval 10s
--health-timeout 5s
--health-retries 30
env:
SQLRULES_TEST_POSTGRESQL_URL: postgresql+psycopg://sqlrules:sqlrules-ci@127.0.0.1:5432/sqlrules
SQLRULES_TEST_MYSQL_URL: mysql+pymysql://sqlrules:sqlrules-ci@127.0.0.1:3306/sqlrules
SQLRULES_TEST_MSSQL_URL: mssql+pymssql://sa:SqlRules-ci%21Passw0rd@127.0.0.1:1433/master
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip

- name: Install
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
python -m pip install "pydantic==2.13.4" "psycopg[binary]" pymysql pymssql
python -m pip install -e packages/sqlrules-postgresql -e packages/sqlrules-sqlite \
-e packages/sqlrules-mysql -e packages/sqlrules-mssql

- name: Execute backend conformance corpus
run: pytest -o addopts='' -q tests/test_live_backend_conformance.py

checks:
name: CI checks
if: always()
Expand All @@ -186,6 +241,7 @@ jobs:
- test
- package
- docs
- database-conformance
runs-on: ubuntu-latest
steps:
- name: Require all jobs
Expand All @@ -195,11 +251,12 @@ jobs:
"${{ needs.test.result }}"
"${{ needs.package.result }}"
"${{ needs.docs.result }}"
"${{ needs.database-conformance.result }}"
)
for result in "${results[@]}"; do
if [[ "$result" != "success" ]]; then
echo "One or more CI jobs failed: ${results[*]}"
exit 1
fi
done
echo "All CI jobs passed (lint, test, package, docs)."
echo "All CI jobs passed (lint, test, package, docs, database conformance)."
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- SQLRules 2.0 `RuleSchema`, Pydantic conversion with deterministic reports,
explicit backend providers, safe scalar preparation, `CompiledRules`, and
`notwhere()`.
- Coordinated 2.0.0 package metadata, API v2 documentation, examples, and
migration guidance.

### Changed

- Compilation now requires SQLRules-compatible declarations and exactly one
explicit backend provider. Every supported scalar annotation is a rule.
- Backend coercion and strictness follow the published 2.0 semantic profile;
retained rules cannot be omitted with warn/ignore settings.

## [1.0.1] - 2026-07-11

### Fixed
Expand Down
Loading
Loading