Repository navigation
feat(postgres): render seconds_between as EXTRACT(EPOCH) - #65
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/v1.0.0.dev17 #65 +/- ##
=====================================================
Coverage 77.90% 77.90%
=====================================================
Files 355 355
Lines 17504 17509 +5
Branches 2805 2805
=====================================================
+ Hits 13636 13641 +5
Misses 2870 2870
Partials 998 998
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
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
Implements the backend half of the portable
seconds_betweenexpression added inrhosocial/python-activerecord#129:
format_seconds_between_expression()rendersend - startin signed, fractional seconds. Subtracting two PostgreSQL timestamps yields an interval, so the formatter wraps the difference inEXTRACT(EPOCH FROM (end - start)), which already carries the sign and the microseconds.The core raises
UnsupportedFeatureErroruntil a dialect adapts the hook, so thischange is what makes the expression usable on this engine. The implementation lives in
src/rhosocial/activerecord/backend/impl/postgres/mixins/datetime.py.Type of change
feat: A new featuredocs: Documentation for the new capabilitytest: Tests for the new capabilitychore: CI installs the core from the feature branch (see below)perf/ci/build/revert: not applicableBreaking Change
Impact on End-Users:
No backward-incompatible changes are expected: the expression is new, and nothing
existing changes shape.
Impact on Backend Developers (Custom Implementations):
None. The dialect hook is additive; implementations that do not override it keep
inheriting the core refusal.
Related Repositories/Packages
Requires rhosocial/python-activerecord#129 (branch
feature/extract-epoch)..github/workflows/test.ymlnow installs the core fromfeature/extract-epochinstead of
release/v1.0.0.dev30, so CI exercises the core change and this backendtogether (see the
chore(ci)commit on this branch). That pin is temporary: it shouldgo back to the release branch once the core PR merges.
Testing
Test Plan:
tests/rhosocial/activerecord_postgres_test/feature/backend/postgres/test_postgres_seconds_between.pyChecklist
README.md, etc.).Additional Notes
The changelog fragment is intentionally deferred until the PR number exists; it is
added as
changelog.d/<pr_number>.added.mdright after the PR opens.