support create trigger#756
Closed
zidaye wants to merge 2 commits into
Closed
Conversation
Pull Request Test Coverage Report for Build 3662567008
💛 - Coveralls |
alamb
reviewed
Dec 28, 2022
Comment on lines
+2358
to
+2384
| let condition = if self.parse_keyword(Keyword::WHEN) { | ||
| self.expect_token(&Token::LParen)?; | ||
| let mut lparen_count = 1; | ||
| let mut condition_str = String::new(); | ||
| loop { | ||
| if lparen_count == 0 { | ||
| break; | ||
| } | ||
| if let Some(next_token) = self.next_token_no_skip() { | ||
| match &next_token.token { | ||
| Token::LParen => lparen_count += 1, | ||
| Token::RParen => lparen_count -= 1, | ||
| Token::EOF => { | ||
| return self.expected(" `)` ", TokenWithLocation::wrap(Token::EOF)); | ||
| } | ||
| _ => {} | ||
| } | ||
| if lparen_count == 0 { | ||
| break; | ||
| } | ||
| condition_str.push_str(next_token.token.to_string().as_str()); | ||
| } | ||
| } | ||
| Some(condition_str) | ||
| } else { | ||
| None | ||
| }; |
Contributor
There was a problem hiding this comment.
I think this code would become much simpler when condition is an Expr
Something like let condition = self.parse_expr()
Contributor
|
This looks very good @zidaye -- thank you. Please mark this as ready for review when it is ready for another look |
Contributor
|
Closing this PR as it is more than 6 months old without activity. Please reopen or make another PR if you plan to keep working on this. |
Contributor
|
Hi - I need this feature, what is the status on this? |
Contributor
|
I don't think there is any update to report |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
refer to :https://www.postgresql.org/docs/current/sql-createtrigger.html