-
Notifications
You must be signed in to change notification settings - Fork 5
Add support for introspecting domain types #380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
56df009
to
631d96d
Compare
static/schema.json
Outdated
@@ -745,7 +745,41 @@ | |||
} | |||
} | |||
}, | |||
"Native_query_sql": { | |||
"NativeQuerySql": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like it's related to @soupi 's recent .sql
files change for native queries rather than domain types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lovely that all we have to really do is say "X is actually Y" and then everything else falls into place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Late review, but I just wanted to say, thank you for teaching me something. 😊
'c', --for composite type | ||
-- 'd' for domain (a predicate-restricted version of a type) | ||
'c', -- for composite type | ||
-- 'd', for domain (a predicate-restricted version of a type) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird comma.
@@ -0,0 +1,5 @@ | |||
-- This file is used to test the support of domain types | |||
|
|||
CREATE DOMAIN even_number int4 CHECK (VALUE % 2 = 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not know you could do this in SQL and now I do.
I'm not sure if this is a blessing or a curse.
What
This PR adds support for introspecting domain types.
How
Prior to this PR domain types were already recognised as scalar types. However, the ability to view a domain type transparently as its base type was not, so you couldn't do anything with values of domain type.
This PR adds cases to the set of implicit casts for domain types in the introspection query, which enables support for comparison operators.