Repository navigation
Pg range types - #27
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds first-class PostgreSQL range/multirange support to the type system and SQLx integration so queries involving range constructors, operators, and functions can be typed and (for supported element types) mapped to sqlx::postgres::types::PgRange.
Changes:
- Extend
qusql-type’sTypemodel + unification logic to represent and matchRange(Box<Type>)andMultiRange(Box<Type>). - Implement typing for PostgreSQL range/multirange constructors, key operators, and several range-related functions (plus
unnest(anymultirange)overload). - Add SQLx-side
PgRange<T>bindings and tests for decoding/bindingdaterange,int4range, and multirange workflows.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| qusql-type/src/typer.rs | Adds recursive type matching for Range/MultiRange. |
| qusql-type/src/type_reference.rs | Extends table-function UNNEST typing to support multirange → range columns. |
| qusql-type/src/type_insert_replace.rs | Tweaks insert/replace missing-column error formatting. |
| qusql-type/src/type_function.rs | Adds typing for range/multirange constructors and functions; updates lower/upper/unnest overload behavior. |
| qusql-type/src/type_expression.rs | Treats MultiRange as non-numeric for unary numeric operators. |
| qusql-type/src/type_binary_expression.rs | Adds range/multirange handling for <</>> and certain user-defined operators. |
| qusql-type/src/type_.rs | Refactors Type::Range to carry an element Type and introduces Type::MultiRange. |
| qusql-type/src/schema.rs | Preserves int4 vs int8 element width when mapping parsed range subtypes into Type. |
| qusql-type/src/lib.rs | Adds regression tests covering parsing/typing of range + multirange operators/functions. |
| qusql-sqlx-type/src/lib.rs | Adds PgRange<T> argument/row bindings behind a postgres feature; re-exports PgRange. |
| qusql-sqlx-type/Cargo.toml | Adds postgres feature and enables sqlx postgres support for dev-tests. |
| qusql-sqlx-type-test/src/test.rs | Adds integration tests for daterange, int4range, and an int8multirange update + unnest() workflow. |
| qusql-sqlx-type-test/sqlx-type-schema.sql | Extends test schema with daterange and int8multirange tables/columns. |
| qusql-sqlx-type-test/Cargo.toml | Enables postgres/uuid support and adds chrono/uuid deps for new tests. |
| qusql-sqlx-type-macro/src/lib.rs | Maps supported PostgreSQL range element types to qusql_sqlx_type::PgRange<...> in generated code. |
| qusql-py-mysql-type-plugin/src/lib.rs | Treats MultiRange as Any for MySQL Python type plugin mapping. |
| qusql-parse/src/keywords.rs | Adds PostgreSQL range-function keywords (isempty, lower_inc, etc.). |
| qusql-parse/src/function_expression.rs | Parses new PostgreSQL range/multirange functions into dedicated Function variants. |
| qusql-mysql-type-macro/src/lib.rs | Adds MultiRange placeholder handling (still todo!()) in MySQL macro mapping. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
antialize
force-pushed
the
pg_range_types
branch
from
July 19, 2026 08:19
941eeb0 to
a3a8e4b
Compare
antialize
force-pushed
the
pg_range_types
branch
from
July 19, 2026 08:24
7d8f2f9 to
157da69
Compare
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.
No description provided.