Repository navigation
refactor: move adapter models to the native core - #381
Merged
Merged
Conversation
copy.copy of a native shape now reuses the instance's field values instead of rebuilding it through the constructor, so coerced mappings and tuples are the same objects in the copy, as they were for the previous dataclasses. Post-init checks do not run again, Python subclasses keep their type and instance dictionary, and deepcopy and pickle are unchanged.
The adapter connection, catalog, query, replay, deployment and warehouse shapes are native classes and adapter/models.py re-exports them. The connection config repr still redacts the password, and named_rows keeps its strict zip errors. No movable Python remains: remaining_lines is 0.
Native shapes now define __replace__ through dataclasses.replace, so copy.replace works on Python 3.13 and later as it did for the previous dataclasses, coercing and validating the replaced fields again.
kvlonge
enabled auto-merge (squash)
November 11, 2026 06:19
Deploying sqltide with
|
| Latest commit: |
5247bd3
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://fd257cc2.sqltide.pages.dev |
| Branch Preview URL: | https://wip-native-adapter-models-3.sqltide.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The adapter models were the last movable Python in SQLTide. Moving them into the native core makes the Python package a thin wrapper and brings the Python boundary's
remaining_linesfrom 1080 to 0.Two copy-protocol gaps in native shapes are also closed.
copy.copyrebuilt shapes through the constructor, so mappings and tuples in the copy were new objects.copy.replacefailed on Python 3.13 and later, although the previous dataclasses supported it there.Changes
adapter/models.pyonly re-exports them.sqltide.adapter.typesand are coerced in the previous order, includingAdapterWarehouseHealth's.named_rowskeeps its strict zip errors.copy.copyof a native shape shares the original's field values, without running coercion or post-init checks again. Python subclasses keep their type and instance dictionary.deepcopyandpickleare unchanged.__replace__throughdataclasses.replace, socopy.replacecoerces and validates the replaced fields again.python-boundary.toml:remaining_lines = 0.Verification
__replace__and the exact redacted repr are covered by unit tests that also pass on 0.65.13.copy.replacegives the same results and errors as 0.65.13, apart from the wording of a misuse error.sqt discover/sqt compileCLI output and dev-server JSON match 0.65.13.make check-ciand the full unit suite pass.