Repository navigation
Conversation
antiguru
added this pull request to stack #38942
September 24, 2026 08:52
antiguru
force-pushed
the
sqlfunc-convert-list
branch
from
September 24, 2026 10:14
e1e3e5f to
f9a0c1b
Compare
antiguru
force-pushed
the
sqlfunc-convert-timestamp
branch
from
September 24, 2026 10:14
4ec5632 to
9aebe53
Compare
antiguru
force-pushed
the
sqlfunc-convert-timestamp
branch
from
September 24, 2026 14:29
9aebe53 to
ab55f6f
Compare
antiguru
force-pushed
the
sqlfunc-convert-list
branch
2 times, most recently
from
September 25, 2026 16:00
4ecb9b0 to
e0ab240
Compare
antiguru
force-pushed
the
sqlfunc-convert-timestamp
branch
from
September 25, 2026 16:00
ab55f6f to
ba19b21
Compare
antiguru
force-pushed
the
sqlfunc-convert-timestamp
branch
from
October 14, 2026 09:11
ba19b21 to
f2987f6
Compare
All sixteen hand-written `EagerUnaryFunc` impls in the file read their payload in
`call`, so each takes a `&self` receiver and the macro attaches the annotated
function as an inherent method on the existing struct.
Four of them need `output_type_expr`. `CastTimestampToTimestampTz`,
`AdjustTimestampPrecision`, `CastTimestampTzToTimestamp` and
`AdjustTimestampTzPrecision` build the output precision out of `self.to`, which
the derived `CheckedTimestamp` column type cannot express. Each expression sets
nullability from the input, and the unary tail adds only `propagates_nulls &&
input_type.nullable`, which the non-nullable timestamp input makes the same
term. `introduces_nulls` derives false from the non-`Option` output. Their
shared `preserves_uniqueness` body carries over verbatim as a block expression
over `self`.
The other twelve need no output modifier. `Result<Numeric, EvalError>`,
`Result<f64, EvalError>`, `Result<CheckedTimestamp<_>, EvalError>` and `String`
derive `Numeric { max_scale: None }`, `Float64`, `Timestamp`/`TimestampTz` with
`precision: None`, and `String` respectively, which is exactly what each
`output_sql_type` returned once the tail is applied.
Per-override accounting: `call` becomes the function body. `is_monotone` carries
over as a constant on the four precision functions and the two `date_trunc`
functions, and as an expression over `self` on `ExtractTimestamp` and
`ExtractTimestampTz`. `inverse` carries over on the two casts. The two
`AdjustTimestamp*Precision` impls overrode `inverse` with `None`, which is the
trait default, so the override disappears. `could_error` stays derived, true for
the `Result` outputs and false for the two `to_char` functions, matching impls
that never overrode it. `propagates_nulls` was never overridden and derives true
from the non-nullable inputs.
The four precision functions wrote a fixed string in `Display`, so `sqlname`
reproduces it. The other twelve format their payload, so they keep their
hand-written `Display` under `skip_display = true`.
`func_registry_records_sqlfunc_sources` used `extract_interval` as its example of
a function with no recorded source. It now uses `cast_array_to_array`, one of the
compound-type casts generic over an `Eval` implementor, a shape the macro does
not cover.
The registry reports only `sqlfunc_signature` moving, on all twenty-six records.
No declared property changed.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
antiguru
force-pushed
the
sqlfunc-convert-list
branch
from
October 14, 2026 15:18
07abebd to
cb7b4a1
Compare
antiguru
force-pushed
the
sqlfunc-convert-timestamp
branch
from
October 14, 2026 15:18
f2987f6 to
7937dc3
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 the sixteen hand-written
EagerUnaryFuncimpls intimestamp.rsto#[sqlfunc]. All of them read their payload, so they take&self. The four precision casts build their output precision fromself.toin anoutput_type_expr. The other twelve print their payload inDisplay, so they keep their hand-written impls underskip_display.func_registry_records_sqlfunc_sourcesswitches its example of a function with no recorded source tocast_array_to_array. The registry reports onlysqlfunc_signaturemoving, on all twenty-six records. No declared property changed.Based on #39095.
🤖 Generated with Claude Code