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

Support TRIM from with optional expr and FROM expr #573

Merged
merged 5 commits into from Aug 15, 2022

Conversation

ayushdg
Copy link
Contributor

@ayushdg ayushdg commented Aug 12, 2022

Fixes #568
The objective of this pr is to allow specifying the chars from expr syntax for the trim expression even without specifying a trim where flag.

  • Update trim expr members, not tying the trimWhere option to the trim_what option
  • Update parsing logic to handle cases with no trim flag but trim_char
  • Add tests

@coveralls
Copy link

coveralls commented Aug 12, 2022

Pull Request Test Coverage Report for Build 2863233291

  • 20 of 22 (90.91%) changed or added relevant lines in 2 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.01%) to 85.433%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/ast/mod.rs 7 9 77.78%
Files with Coverage Reduction New Missed Lines %
src/parser.rs 1 83.25%
Totals Coverage Status
Change from base Build 2848542264: -0.01%
Covered Lines: 9507
Relevant Lines: 11128

💛 - Coveralls

@ayushdg ayushdg marked this pull request as ready for review August 15, 2022 20:18
@alamb alamb changed the title Update trim Expr to allow parsing chars from string without a where flag Support TRIM from string without a where clause Aug 15, 2022
Copy link
Collaborator

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Looks good to me -- thanks @ayushdg

@alamb alamb changed the title Support TRIM from string without a where clause Support TRIM from with optional FROM clause Aug 15, 2022
@alamb alamb changed the title Support TRIM from with optional FROM clause Support TRIM from with optional expr and FROM expr Aug 15, 2022
@alamb alamb merged commit 42c5d43 into sqlparser-rs:main Aug 15, 2022
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.

Trim syntax without trimWhere and From not supported.
3 participants