Skip to content

support parse create function #19

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

Closed
wants to merge 0 commits into from
Closed

Conversation

donga-gao
Copy link
Contributor

  1. support parse create function
  2. Issue add sql_segment

Copy link
Owner

@antialize antialize left a comment

Choose a reason for hiding this comment

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

Please split this into two separate commits. One with the issue refactor, one with the changes to create_function.

Why do you want to add the "sql_segment" to the Issue. It seems that is is just the code under span. If we want to add these sql_segments to the Issue. Perhaps we could add a lifetime to issue, and have the sql_segments an slices, so we do not need to allocate new strings.

src/create.rs Outdated
if parser.options.dialect.is_maria() && direction.is_none() {
parser.expected_error("'IN', 'OUT' or 'INOUT'");
}
// [IN|OUT|INOUT] is not required in mysql
Copy link
Owner

Choose a reason for hiding this comment

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

If this is indeed the case, please remove the code instead of commenting it out.

src/statement.rs Outdated
@@ -277,6 +277,7 @@ pub enum Statement<'a> {
TruncateTable(TruncateTable<'a>),
RenameTable(RenameTable<'a>),
WithQuery(WithQuery<'a>),
RETURN(Return<'a>),
Copy link
Owner

Choose a reason for hiding this comment

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

The enum variant should be called Return not RETURN

src/create.rs Outdated
@@ -638,78 +602,12 @@ fn parse_create_function<'a>(
}
}

let mut characteristics = Vec::new();
Copy link
Owner

Choose a reason for hiding this comment

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

Where did the characteristic go?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

function characteristics is not suitable for parse function body. function body is more like block statement. So I add Return sql in statement for parse function body as a block statement.

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