-
-
Notifications
You must be signed in to change notification settings - Fork 195
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
[join-lateral] #224
[join-lateral] #224
Conversation
/// assert_eq!( | ||
/// query.to_string(SqliteQueryBuilder), | ||
/// r#"SELECT `name` FROM `font` LEFT JOIN LATERAL (SELECT `id` FROM `glyph`) AS `sub_glyph` ON `font`.`id` = `sub_glyph`.`id`"# | ||
/// ); |
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.
JOIN LATERAL
seems not supported by SQLite. We shouldn't generate invalid select statement
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.
how do i error on sqlite within the builder?
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.
We could panic!
when building the select statement for SQLite. Is this be reasonable? @tyt2y3 It's better to let the user know explicitly something went wrong early.
pub fn join_lateral_subquery<T, C>( | ||
&mut self, | ||
join: JoinType, | ||
query: SelectStatement, | ||
alias: T, | ||
condition: C, | ||
) -> &mut Self | ||
where | ||
T: IntoIden, | ||
C: IntoCondition, |
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'm thinking this method could simply be named join_lateral
. As it's assumed to take a (sub)query as argument. What do you think?
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.
yup, that makes sense 👍
I think the |
I noticed this was merged into it's own branch. Has any further work been done on it? Should I make another pr with those changes or is there a different direction we're heading in? |
@billy1624 hello, any thoughts? |
It was later cherry picked into master, see 12c1292 |
thank you, do i need to follow up with the above adjustments you suggested? if so, i'm still not sure where to insert the |
I can open a PR for that :P |
Hey @rex-remind101, I have open an PR (#243) for this |
added support for
JOIN LATERAL
as specified in MySQL and Postgres #201