Infer timestamptz columns as TimestamptzString - #30301
Open
Sanjays2402 wants to merge 1 commit into
Open
Sanjays2402 wants to merge 1 commit into
Sanjays2402 wants to merge 1 commit into
Conversation
contract infer mapped timestamptz to the Temporal-backed Timestamptz, whose codec needs a global Temporal. Runtimes without it (e.g. Node 24) throw RUNTIME.TEMPORAL_UNAVAILABLE on the first read of an inferred contract, and orm init already scaffolds TimestamptzString for the same columns - so inference and init disagreed. Map timestamptz (and its parameterized and longhand spellings) to TimestamptzString at inference time instead. Fixes prisma#30252.
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (6)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughChangesPostgreSQL timestamptz inference
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The adapter normalizes precision-qualified timestamp-with-time-zone types before mapping, leaving no unresolved merge-blocking behavior in this change. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
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.
Fixes #30252.
contract infermapped PostgreSQLtimestamptzto the Temporal-backedTimestamptz, whose codec requires a globalTemporal. Runtimes without it (e.g. Node 24) throwRUNTIME.TEMPORAL_UNAVAILABLEon the first read of an inferred contract.orm initalready scaffoldsTimestamptzStringfor the same columns, so inference and init disagreed with each other.This maps
timestamptz— including thetimestamp with time zonelonghand and parameterized forms liketimestamptz(6)— toTimestamptzStringat inference time.Testing: regression tests cover the plain, longhand, and parameterized spellings plus a
pg/timestamptz-string@1round-trip; the tests were verified to fail before the fix. PostgreSQL PSL-inference suite (152 tests), print-PSL suite (68 tests), and affected adapter tests (142 tests) pass;biome checkclean on changed files.Summary by CodeRabbit
New Features
timestamptzandtimestamp with time zonecolumns are now inferred and rendered asTimestamptzString.timestamptz(6).Documentation
Temporal, and thatTimestamptzStringis the default introspected spelling.