Fast-path canonical PostgreSQL dates - #30187
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe PostgreSQL temporal codec now reads ChangesPostgreSQL temporal codec
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This localized PostgreSQL date-decoding optimization preserves fallback behavior for noncanonical inputs, and no actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
@prisma/orm-extension-arktype-json
@prisma/orm-extension-middleware-cache
@prisma/orm-extension-paradedb
@prisma/orm-extension-pgvector
@prisma/orm-extension-postgis
@prisma/orm-extension-supabase
@prisma/orm-family-mongo
@prisma/orm-family-sql
@prisma/orm-framework
@prisma/orm-mongo
@prisma/orm-postgres
@prisma/orm-sqlite
@prisma/orm-target-mongo
@prisma/orm-target-postgres
@prisma/orm-target-sqlite
@prisma/orm-toolchain
commit: |
size-limit report 📦
|
aaef5ef to
707d55f
Compare
d20d3ba to
375ca63
Compare
Parse the ordinary YYYY-MM-DD wire form with digit arithmetic and construct Temporal.PlainDate directly while preserving the generic parser for BC, expanded-year, sentinel, and malformed values. Metric: result_set_total_us 809.2us -> 679.0us (-16.1%). Signed-off-by: Steven McClankerton <tatarintsev@prisma.io>
Signed-off-by: Steven McClankerton <tatarintsev@prisma.io>
104ddf4 to
4d0c91f
Compare
43b39a0 to
0380a6c
Compare
Linked issue
n/a — performance work without a tracking issue
Prerequisite: #30186.
Summary
Fast-paths the canonical PostgreSQL
YYYY-MM-DDwire form with directTemporal.PlainDateconstruction while retaining the existing parser for every noncanonical representation. On top of the runtime optimization PR, aggregate whole-result-set latency improves from 809.2 µs to 679.0 µs.At a glance
Only fixed-width ASCII dates reach this constructor path.
Decision
Recognize and validate the ordinary server representation using character codes, then construct the immutable Temporal value directly. BC dates, expanded years, sentinels, malformed input, and other noncanonical forms continue through the existing adaptation and
Temporal.PlainDate.frombehavior.Reviewer notes
Reflect.getwith typedSymbol.toStringTagaccess while preserving the existing runtime guard, satisfying the production-code structural lint without changing wrong-type handling.Behavior changes & evidence
packages/3-targets/3-targets/postgres/src/core/temporal-codec-helpers.ts.packages/3-targets/3-targets/postgres/test/temporal-codecs.test.ts.Testing performed
pnpm --filter @internal/target-postgres test— 93 files, 1596 testspnpm --filter @internal/target-postgres typecheckpnpm --filter benchmarks benchSkill update
n/a — internal codec implementation optimization with unchanged public behavior
Checklist
git commit -s) per the DCO.TML-NNNN: <sentence-case title>form — no Linear ticket exists for this work.Notes for the reviewer
This is the final PR in the stack and contains only the PostgreSQL date-codec optimization plus the typed property-access cleanup required in the touched helper.
Alternatives considered
Temporal.PlainDate.fromfor canonical dates: simpler, but it dominates date-heavy result-set latency.Summary by CodeRabbit
yyyy-mm-ddvalues.