feat(pg-core): add native daterange column type#5613
Open
alexbaileyuk wants to merge 3 commits intodrizzle-team:mainfrom
Open
feat(pg-core): add native daterange column type#5613alexbaileyuk wants to merge 3 commits intodrizzle-team:mainfrom
alexbaileyuk wants to merge 3 commits intodrizzle-team:mainfrom
Conversation
Adds first-class support for the PostgreSQL `daterange` column type, addressing part of drizzle-team#2700. Includes shared range parsing infrastructure (PgRange<T>, parseRange, serializeRange) designed for reuse when adding the remaining range/multirange types. Supports two modes: - Object mode (default): parses to PgRange<string> with lower/upper bounds, inclusivity flags, and empty detection - String mode: passes raw PG text through unchanged Also adds drizzle-kit introspection support so `daterange` columns are correctly recognized during `pull`. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace loose toBeTruthy() checks with exact toEqual() assertions where PG canonicalization doesn't alter the output (upper bound already exclusive). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
Adds first-class support for the PostgreSQL
daterangecolumn type, partially addressing #2700.daterange()column builder with two modes:PgRange<string>with typed lower/upper bounds, inclusivity flags, and empty range detectionPgRange<T>,parseRange,serializeRange) inrange.common.ts, designed for reuse when adding the remaining range/multirange types (int4range,int8range,numrange,tsrange,tstzrange, and their multirange counterparts)drizzle-kitintrospection support sodaterangecolumns are correctly recognized duringpullUsage
Test plan
drizzle-kitpg-columns tests pass (no regressions)drizzle-ormtype-checks cleanlydrizzle-kit push+pullround-trip with a live PG database🤖 Generated with Claude Code