Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 9 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
- name: Install activerecord and testsuite from PyPI
run: |
pip install "rhosocial-activerecord @ git+https://github.com/rhosocial/python-activerecord.git@release/v1.0.0.dev30"
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@feature/expression-schema-object-refactor"
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@test/typed-column-contracts"

Check warning on line 63 in .github/workflows/test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=rhosocial_python-activerecord-sqlserver&issues=AaEqCeV0wkxJ0OGsaSCG&open=AaEqCeV0wkxJ0OGsaSCG&pullRequest=8

Check warning on line 63 in .github/workflows/test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--only-binary :all:" can lead to the execution of setup scripts. Make sure it is safe here.

See more on https://sonarcloud.io/project/issues?id=rhosocial_python-activerecord-sqlserver&issues=AaEqCeV0wkxJ0OGsaSCF&open=AaEqCeV0wkxJ0OGsaSCF&pullRequest=8

- name: Create test database
run: |
Expand Down Expand Up @@ -150,7 +150,7 @@
- name: Install activerecord and testsuite from PyPI
run: |
pip install "rhosocial-activerecord @ git+https://github.com/rhosocial/python-activerecord.git@release/v1.0.0.dev30"
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@feature/expression-schema-object-refactor"
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@test/typed-column-contracts"

Check warning on line 153 in .github/workflows/test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--only-binary :all:" can lead to the execution of setup scripts. Make sure it is safe here.

See more on https://sonarcloud.io/project/issues?id=rhosocial_python-activerecord-sqlserver&issues=AaEqCeV0wkxJ0OGsaSCH&open=AaEqCeV0wkxJ0OGsaSCH&pullRequest=8

Check warning on line 153 in .github/workflows/test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=rhosocial_python-activerecord-sqlserver&issues=AaEqCeV0wkxJ0OGsaSCI&open=AaEqCeV0wkxJ0OGsaSCI&pullRequest=8

- name: Create test database
run: |
Expand Down Expand Up @@ -240,7 +240,7 @@
- name: Install activerecord and testsuite from PyPI
run: |
pip install "rhosocial-activerecord @ git+https://github.com/rhosocial/python-activerecord.git@release/v1.0.0.dev30"
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@feature/expression-schema-object-refactor"
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@test/typed-column-contracts"

Check warning on line 243 in .github/workflows/test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--only-binary :all:" can lead to the execution of setup scripts. Make sure it is safe here.

See more on https://sonarcloud.io/project/issues?id=rhosocial_python-activerecord-sqlserver&issues=AaEqCeV0wkxJ0OGsaSCJ&open=AaEqCeV0wkxJ0OGsaSCJ&pullRequest=8

Check warning on line 243 in .github/workflows/test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=rhosocial_python-activerecord-sqlserver&issues=AaEqCeV0wkxJ0OGsaSCK&open=AaEqCeV0wkxJ0OGsaSCK&pullRequest=8

- name: Create test database
run: |
Expand Down Expand Up @@ -330,7 +330,7 @@
- name: Install activerecord and testsuite from PyPI
run: |
pip install "rhosocial-activerecord @ git+https://github.com/rhosocial/python-activerecord.git@release/v1.0.0.dev30"
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@feature/expression-schema-object-refactor"
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@test/typed-column-contracts"

Check warning on line 333 in .github/workflows/test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--only-binary :all:" can lead to the execution of setup scripts. Make sure it is safe here.

See more on https://sonarcloud.io/project/issues?id=rhosocial_python-activerecord-sqlserver&issues=AaEqCeV0wkxJ0OGsaSCL&open=AaEqCeV0wkxJ0OGsaSCL&pullRequest=8

Check warning on line 333 in .github/workflows/test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=rhosocial_python-activerecord-sqlserver&issues=AaEqCeV0wkxJ0OGsaSCM&open=AaEqCeV0wkxJ0OGsaSCM&pullRequest=8

- name: Create test database
run: |
Expand Down Expand Up @@ -420,7 +420,7 @@
- name: Install activerecord and testsuite from PyPI
run: |
pip install "rhosocial-activerecord @ git+https://github.com/rhosocial/python-activerecord.git@release/v1.0.0.dev30"
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@feature/expression-schema-object-refactor"
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@test/typed-column-contracts"

Check warning on line 423 in .github/workflows/test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--only-binary :all:" can lead to the execution of setup scripts. Make sure it is safe here.

See more on https://sonarcloud.io/project/issues?id=rhosocial_python-activerecord-sqlserver&issues=AaEqCeV0wkxJ0OGsaSCN&open=AaEqCeV0wkxJ0OGsaSCN&pullRequest=8

Check warning on line 423 in .github/workflows/test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=rhosocial_python-activerecord-sqlserver&issues=AaEqCeV0wkxJ0OGsaSCO&open=AaEqCeV0wkxJ0OGsaSCO&pullRequest=8

- name: Create test database
run: |
Expand Down Expand Up @@ -510,7 +510,7 @@
- name: Install activerecord and testsuite from PyPI
run: |
pip install "rhosocial-activerecord @ git+https://github.com/rhosocial/python-activerecord.git@release/v1.0.0.dev30"
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@feature/expression-schema-object-refactor"
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@test/typed-column-contracts"

Check warning on line 513 in .github/workflows/test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=rhosocial_python-activerecord-sqlserver&issues=AaEqCeV0wkxJ0OGsaSCQ&open=AaEqCeV0wkxJ0OGsaSCQ&pullRequest=8

Check warning on line 513 in .github/workflows/test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--only-binary :all:" can lead to the execution of setup scripts. Make sure it is safe here.

See more on https://sonarcloud.io/project/issues?id=rhosocial_python-activerecord-sqlserver&issues=AaEqCeV0wkxJ0OGsaSCP&open=AaEqCeV0wkxJ0OGsaSCP&pullRequest=8

- name: Create test database
run: |
Expand Down Expand Up @@ -601,7 +601,7 @@
- name: Install activerecord and testsuite from PyPI
run: |
pip install "rhosocial-activerecord @ git+https://github.com/rhosocial/python-activerecord.git@release/v1.0.0.dev30"
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@feature/expression-schema-object-refactor"
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@test/typed-column-contracts"

Check warning on line 604 in .github/workflows/test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--only-binary :all:" can lead to the execution of setup scripts. Make sure it is safe here.

See more on https://sonarcloud.io/project/issues?id=rhosocial_python-activerecord-sqlserver&issues=AaEqCeV0wkxJ0OGsaSCR&open=AaEqCeV0wkxJ0OGsaSCR&pullRequest=8

Check warning on line 604 in .github/workflows/test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=rhosocial_python-activerecord-sqlserver&issues=AaEqCeV0wkxJ0OGsaSCS&open=AaEqCeV0wkxJ0OGsaSCS&pullRequest=8

- name: Create test database
run: |
Expand Down Expand Up @@ -691,7 +691,7 @@
- name: Install activerecord and testsuite from PyPI
run: |
pip install "rhosocial-activerecord @ git+https://github.com/rhosocial/python-activerecord.git@release/v1.0.0.dev30"
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@feature/expression-schema-object-refactor"
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@test/typed-column-contracts"

Check warning on line 694 in .github/workflows/test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--only-binary :all:" can lead to the execution of setup scripts. Make sure it is safe here.

See more on https://sonarcloud.io/project/issues?id=rhosocial_python-activerecord-sqlserver&issues=AaEqCeV0wkxJ0OGsaSCT&open=AaEqCeV0wkxJ0OGsaSCT&pullRequest=8

Check warning on line 694 in .github/workflows/test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=rhosocial_python-activerecord-sqlserver&issues=AaEqCeV0wkxJ0OGsaSCU&open=AaEqCeV0wkxJ0OGsaSCU&pullRequest=8

- name: Create test database
run: |
Expand Down Expand Up @@ -790,7 +790,7 @@
- name: Install activerecord and testsuite from PyPI
run: |
pip install "rhosocial-activerecord @ git+https://github.com/rhosocial/python-activerecord.git@release/v1.0.0.dev30"
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@feature/expression-schema-object-refactor"
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@test/typed-column-contracts"

Check warning on line 793 in .github/workflows/test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=rhosocial_python-activerecord-sqlserver&issues=AaEqCeV0wkxJ0OGsaSCW&open=AaEqCeV0wkxJ0OGsaSCW&pullRequest=8

Check warning on line 793 in .github/workflows/test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--only-binary :all:" can lead to the execution of setup scripts. Make sure it is safe here.

See more on https://sonarcloud.io/project/issues?id=rhosocial_python-activerecord-sqlserver&issues=AaEqCeV0wkxJ0OGsaSCV&open=AaEqCeV0wkxJ0OGsaSCV&pullRequest=8

- name: Create test database
run: |
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ _b69f713_
- **CI-tested server versions**: 2017, 2019, 2022, 2025
- **Published**: PyPI `1.0.0.dev2`

`pyodbc` 5.3.0 ships no cp315 wheel — the source tarball only, with no
`Python :: 3.15` classifier declaring support — so a 3.15 leg would fail at
install while pip compiles the driver. Adding one awaits a `pyodbc` release,
not anything in this repository.

## Installation

```bash
Expand Down
1 change: 1 addition & 0 deletions changelog.d/8.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Implement core's ColumnTypeSupport protocol for SQL Server through SQLServerColumnTypeMixin and the SQLSERVER_COLUMN_TYPES table, an eighteen-entry answer for every common Python type — str is a StringColumn, list/dict/tuple/set/frozenset are JSONColumns (this server has no array type on any version, and a document is text in NVARCHAR(MAX) that the 2016 function family reads), uuid.UUID a UUIDColumn, enum.Enum a StringColumn and datetime.timedelta a NumericColumn (a span here is a DATEDIFF count) — with each deviation recorded against its measured 2019 / 2022 / 2025 evidence and each deliberate omission stated in the module docstring rather than left to be inferred. Also declare the SQLServerTypeSupport protocol, the stated shape of the sqlserver_-prefixed type family (whether xml is a real type here, whether BIT is a boolean, whether tinyint is signed); render the new trim node through SQLServerTrimMixin, which keeps the operand order this server had first (BOTH becomes TRIM(chars FROM x) / TRIM(x), LEADING becomes LTRIM, TRAILING becomes RTRIM) and records its compatibility-level limits instead of gating them; compose SQLServerUUIDMixin so this backend's NEWID and UNIQUEIDENTIFIER spellings win over core's single fixed spelling; declare STRING_CONCATENATION = "CONCAT", because T-SQL reads || as logical OR; and add the column-type table, node-class enumeration and table-type definition round-trip test coverage.
1 change: 1 addition & 0 deletions changelog.d/8.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Rework suggested_data_types() into a documented answer to "concepts SQL Server cannot spell, and what it stores instead": the keys are exactly the core types this dialect does not render (binary and varbinary as BlobType, interval as BigIntType, array and jsonb as JsonType, enum as VarCharType, timetz as TimeType, and uuid under this backend's own SQLServerUniqueIdentifierType, because T-SQL writes UNIQUEIDENTIFIER and the dispatch key has to be a word this backend can produce), while xml and timestamptz stay out of the table because the server has native types for them. Follow the core's renames of DateTimeColumn to TimestampColumn and DateTimeSupport to TimestampSupport, and migrate the tests to the rebuilt DDL-source accessors (column_type() / columns_type() become column_data_type() / columns_data_type()) and to building predicates, DDL check conditions and index conditions as explicit nodes now that the bare Column offers no operators.
1 change: 1 addition & 0 deletions changelog.d/8.docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Record in the README why there is no Python 3.15 CI leg: pyodbc 5.3.0 ships no cp315 wheel (source tarball only, with no Python :: 3.15 classifier), so a 3.15 leg would fail at install while pip compiles the driver, and adding one awaits a pyodbc release rather than anything in this repository.
1 change: 1 addition & 0 deletions changelog.d/8.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix sqlserver_-prefixed DataType names silently dropping out of supports_data_types(): the resolver walks the live DataType subclass tree, so a name whose own class nothing had imported yet resolved to None and vanished from the mapping — unnoticed, because every test that looked at the mapping had happened to import a SQLServer* class in its own import block first, which is exactly the load that was missing. The type-formatter registration path now imports this backend's own DataType classes before resolution runs.
1 change: 1 addition & 0 deletions changelog.d/8.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Enumerate every core node class in the expression round-trip matrix by walking the package deterministically instead of the process-global ExpressionRegistry, whose contents depended on which sibling test modules pytest happened to import first, and pin UNMODELLED_FORMATTERS and UNCONSTRUCTIBLE in both directions so a dispatch refusal must be a row with a stated reason (SQL Server has no LPAD / RPAD / REPEAT functions, no SQL/XML feature set and no DOMAIN object) instead of passing as "unsupported". Point the CI core install at release/v1.0.0.dev30 now that typed-columns has merged there, and pin pydantic 2.12.2 / pydantic-core 2.41.4 on Python 3.13 and 3.13t, mirroring the core's pins.
16 changes: 15 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,18 @@ pytest-asyncio
pytest-cov
pytest-benchmark
pytest-xdist
coverage>=7.0.0
coverage>=7.0.0

# Python 3.13, including the free-threaded 3.13t build. The python_version
# marker distinguishes release lines, not GIL configuration, so these two lines
# pin both 3.13 builds. pydantic-core has no cp313t wheel after 2.41.4, and the
# newer sdists cannot be built there (PyO3 0.29 refuses the free-threaded build
# of CPython < 3.14); 2.12.2 is the last pydantic paired with 2.41.4.
#
# These mirror the same pins in rhosocial-activerecord's own dependencies, and
# they have to be restated here because this file is installed before the core
# package: resolving an unpinned `pydantic` here picks a pydantic-core whose only
# cp313t distribution is an sdist, and the build then fails on the free-threaded
# jobs before the core's pin is ever in scope.
pydantic[email]==2.12.2; python_version == '3.13'
pydantic-core==2.41.4; python_version == '3.13'
Loading
Loading