Repository navigation
Conversation
antiguru
added this pull request to stack #38942
September 24, 2026 08:52
antiguru
force-pushed
the
sqlfunc-convert-date
branch
from
September 24, 2026 10:14
39c186f to
f2e201e
Compare
antiguru
force-pushed
the
sqlfunc-convert-jsonb
branch
from
September 24, 2026 10:14
960542c to
b107894
Compare
antiguru
force-pushed
the
sqlfunc-convert-date
branch
2 times, most recently
from
September 25, 2026 16:00
d45e6db to
893ab72
Compare
antiguru
force-pushed
the
sqlfunc-convert-jsonb
branch
from
September 25, 2026 16:00
205c406 to
862741f
Compare
antiguru
force-pushed
the
sqlfunc-convert-date
branch
from
October 14, 2026 09:11
893ab72 to
27ae985
Compare
antiguru
force-pushed
the
sqlfunc-convert-jsonb
branch
from
October 14, 2026 09:11
862741f to
4adb0cd
Compare
`CastDateToTimestamp`, `CastDateToTimestampTz` and `ExtractDate` all read their
payload in `call`, so each takes a `&self` receiver.
The two casts need `output_type_expr`: their `output_sql_type` built the
precision out of the payload, which the derived `CheckedTimestamp` column type
cannot express. The expression sets nullability from the input and the macro's
unary tail adds only `propagates_nulls && input_type.nullable`, which the
non-nullable `Date` input makes the same term. `introduces_nulls` derives false
from the non-`Option` output.
`ExtractDate` needs no output modifier. Its `output_sql_type` returned
`Numeric { max_scale: None }.nullable(input.nullable)`, which is exactly what
`Result<Numeric, EvalError>` derives once the tail is applied.
Per-override accounting, for all three: `call` becomes the function body.
`preserves_uniqueness = true` and `inverse` carry over on the casts as
modifiers, `is_monotone = true` likewise, and `ExtractDate` keeps its
payload-dependent `is_monotone` as an expression over `self`. `could_error`
stays derived, true for the `Result` outputs, matching impls that never
overrode it. `propagates_nulls` was never overridden and derives true from the
non-nullable input.
The casts' `Display` wrote a fixed string, so `sqlname` reproduces it, and the
SQL names differ from the function names. `ExtractDate` formats its payload, so
it keeps its hand-written `Display` under `skip_display = true`.
The registry reports only `sqlfunc_signature` moving, on all six records.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
antiguru
force-pushed
the
sqlfunc-convert-date
branch
from
October 14, 2026 15:18
27ae985 to
add3025
Compare
antiguru
removed this pull request from stack #38942
October 14, 2026 15:45
Member
Author
|
Folded into #39062, which now carries all twenty file conversions as separate commits, per review feedback to land them as one PR. Posted by Claude Code. |
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.
Converts
CastDateToTimestamp,CastDateToTimestampTzandExtractDateto#[sqlfunc]. All three read their payload, so they take&self. The two casts build their output precision from the payload in anoutput_type_expr.ExtractDateprints its payload inDisplay, so it keeps its hand-written impl underskip_display.The registry reports only
sqlfunc_signaturemoving, on all six records.Based on #39088.
🤖 Generated with Claude Code