Skip to content
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

Merged
merged 2 commits into from
Oct 24, 2023
Merged

feat: improve codegen #3737

merged 2 commits into from
Oct 24, 2023

Conversation

aljazerzen
Copy link
Member

@aljazerzen aljazerzen commented Oct 24, 2023

No description provided.

@aljazerzen aljazerzen changed the title aljaz 3 feat: improve codegen Oct 24, 2023
@aljazerzen aljazerzen enabled auto-merge (squash) October 24, 2023 10:56
@aljazerzen aljazerzen merged commit 7e8e8f9 into main Oct 24, 2023
@aljazerzen aljazerzen deleted the aljaz-3 branch October 24, 2023 10:59
Comment on lines +181 to +192
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)
}
Copy link
Member

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!

Comment on lines +9 to +11
group {a.album_id, a.title} (aggregate price = (
sum tracks.unit_price
))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants