Skip to content

Robust and extensible SQL precedence/parentheses mechanism #23895

@roji

Description

@roji

At the moment our SQL generation isn't aware of the precedence of operators and other constructs; to avoid incorrect precedence, we just always place parentheses around SqlBinaryExpression and LikeExpression. We could have a more robust mechanism that identifies when parentheses are actually necessary based on precedence, including extensibility to provider-specific expression/operator types.

Note: since it's always possible to just always put parentheses around certain expression types (like we do now), this is basically a non-urgent SQL prettiness issue.

Originally raised in #3055

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions