-
Notifications
You must be signed in to change notification settings - Fork 225
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
feat: improve codegen #3737
feat: improve codegen #3737
Conversation
fn break_line_within_parenthesis<T: WriteSource>(expr: &T, mut opt: WriteOpt) -> Option<String> { | ||
let mut r = "(\n".to_string(); | ||
opt.indent += 1; | ||
r += &opt.write_indent(); | ||
opt.reset_line()?; | ||
r += &expr.write(opt.clone())?; | ||
r += "\n"; | ||
opt.indent -= 1; | ||
r += &opt.write_indent(); | ||
r += ")"; | ||
Some(r) | ||
} |
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.
Very nice!
This isn't easy!
group {a.album_id, a.title} (aggregate price = ( | ||
sum tracks.unit_price | ||
)) |
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.
Great!
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 isn't ideal - it could be fine-tuned so it breaks before aggregate
instead of sum
.
No description provided.