-
-
Notifications
You must be signed in to change notification settings - Fork 218
Add pseudo tables #987
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
base: master
Are you sure you want to change the base?
Add pseudo tables #987
Conversation
src/types/iden/compound.rs
Outdated
/// NEW.* | ||
New(DynIden), | ||
/// Old.* | ||
Old(DynIden), | ||
#[cfg(feature = "backend-postgres")] | ||
/// excluded.* | ||
Excluded(DynIden), |
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.
To we really need these special variants? These table names look like they can be already expressed as "regular" table names: ColumnRef::from(("OLD", MyColumn))
It may be enough to define some unit-struct idens for these tables and document the approach.
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.
prepare_iden will quote them, but they cannot be quoted.
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.
Ok, I see. Then, I wouldn't change ColumnRef
at all. We don't need to do anything with the "column basename" part. We need to somehow allow unquoted TableName
s (which would then be stored in ColumnRef
as usual) and provide a way to construct unquoted TableName
s ergonomically
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.
Also, your current approach doesn't support asterisk, like NEW.*
(literally *
in the query)
This means the glob pattern, not the SQL asterisk. |
I understand. I'm pointing out that the SQL asterisk is also valid with these tables. I'd like to find a clean way to support it right away |
I think we could add an enum of pseudo tables/columns and regular idens. |
Close #842