Repository navigation
refactor: migrate functions from types to functions modules - #24
Merged
Merged
Conversation
Split responsibilities between types and functions modules for text search and XML: **Text Search** - Create: functions/text_search.py with SQL generation functions - Moved functions (14 total): - to_tsvector, to_tsquery, plainto_tsquery, phraseto_tsquery, websearch_to_tsquery - ts_matches, ts_matches_expr, ts_rank, ts_rank_cd, ts_headline - tsvector_concat, tsvector_strip, tsvector_setweight, tsvector_length - Retained in types/text_search.py: PostgresTsVector, PostgresTsQuery, and related classes **XML** - Create: functions/xml.py with SQL generation functions - Moved functions (4 total): xmlparse, xpath_query, xpath_exists, xml_is_well_formed - Retained in types/xml.py: PostgresXML class **Module Updates** - functions/__init__.py: Export all new text search and XML functions - types/__init__.py: Remove function exports, keep only type exports - backend/__init__.py: Update imports to use functions.text_search - test_xml_types.py: Update to import functions from functions.xml **Benefits** - Clear separation of concerns: types for data structures, functions for SQL generators - Better module organization following single responsibility principle - Easier maintenance and discoverability of SQL generation utilities Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## release/v1.0.0.dev10 #24 +/- ##
========================================================
+ Coverage 72.71% 72.73% +0.02%
========================================================
Files 119 121 +2
Lines 6860 6867 +7
Branches 1139 1139
========================================================
+ Hits 4988 4995 +7
Misses 1470 1470
Partials 402 402
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
4 of 12 tasks
vistart
added a commit
that referenced
this pull request
Apr 12, 2026
* refactor: migrate functions from types to functions modules Split responsibilities between types and functions modules for text search and XML: **Text Search** - Create: functions/text_search.py with SQL generation functions - Moved functions (14 total): - to_tsvector, to_tsquery, plainto_tsquery, phraseto_tsquery, websearch_to_tsquery - ts_matches, ts_matches_expr, ts_rank, ts_rank_cd, ts_headline - tsvector_concat, tsvector_strip, tsvector_setweight, tsvector_length - Retained in types/text_search.py: PostgresTsVector, PostgresTsQuery, and related classes **XML** - Create: functions/xml.py with SQL generation functions - Moved functions (4 total): xmlparse, xpath_query, xpath_exists, xml_is_well_formed - Retained in types/xml.py: PostgresXML class **Module Updates** - functions/__init__.py: Export all new text search and XML functions - types/__init__.py: Remove function exports, keep only type exports - backend/__init__.py: Update imports to use functions.text_search - test_xml_types.py: Update to import functions from functions.xml **Benefits** - Clear separation of concerns: types for data structures, functions for SQL generators - Better module organization following single responsibility principle - Easier maintenance and discoverability of SQL generation utilities Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: add changelog fragment for PR #24 --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
vistart
added a commit
that referenced
this pull request
Oct 11, 2026
…mn-contracts has merged The testsuite's typed-column contracts landed in its own release branch (#24), so the branch this repo installed them from is both stale and about to be deleted. Point the testsuite dependency at `release/v1.0.0.dev17`, the same release branch the core dependency already uses. Contract content is identical -- the release tip is the merge of this branch, not a rewrite -- so this changes only where the contracts come from, not what they assert.
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.



Description
Refactors SQL function generation utilities by migrating them from
types/tofunctions/directory, following the module responsibility separation principle.Changes:
functions/text_search.py(new): Contains 14 text search functions (to_tsvector, to_tsquery, plainto_tsquery, phraseto_tsquery, websearch_to_tsquery, ts_matches, ts_matches_expr, ts_rank, ts_rank_cd, ts_headline, tsvector_concat, tsvector_strip, tsvector_setweight, tsvector_length)functions/xml.py(new): Contains 4 XML functions (xmlparse, xpath_query, xpath_exists, xml_is_well_formed)types/text_search.py: Removed functions, retained types (PostgresTsVector, PostgresTsQuery, etc.)types/xml.py: Removed functions, retained types (PostgresXML)Affected Files:
Type of change
refactor: A code restructuring without behavior changefeat: A new featuredocs: Documentation only changesperf: A code change that improves performancetest: Adding missing tests or correcting existing testschore: Changes to the build process or auxiliary toolsci: Changes to our CI configuration files and scriptsbuild: Changes that affect the build system or external dependenciesrevert: Reverts a previous commitBreaking Change
Applicable
rhosocial-activerecordVersion Range:Related Repositories/Packages
python-activerecord(core package): Backend module import source changedpython-activerecord-testsuite: Tests using postgres backend may need import updatesTesting
Test Plan:
fix/move-functions-from-typesvs corerelease/v1.0.0.dev20Checklist
README.md, etc.).changelog.d/<issue_number>.<type>.md).Additional Notes