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

Split trailing semicolon #742

Closed
Bisk1 opened this issue Oct 10, 2023 · 3 comments
Closed

Split trailing semicolon #742

Bisk1 opened this issue Oct 10, 2023 · 3 comments
Milestone

Comments

@Bisk1
Copy link

Bisk1 commented Oct 10, 2023

Is your feature request related to a problem? Please describe.
Trino is one of the few execution engines that does not accept a trailing semi-colon. sqlparse leaves the semi-colon after splitting. This means that the strings in result list of sqlparse.raw(raw) are not valid SQL for all execution engines.

Describe the solution you'd like
Semicolon at the end of statements should be omitted by default (it seems like a safe choice). Alternatively it could be done with a configuration option.

Describe alternatives you've considered
The alternative is e.g. to have a separate trimming process that post-processes the result of sqlparse.split(raw). However trimming unnecessary characters feels like a part of splitting process.

Additional context
See related Airflow issue: apache/airflow#34828

@andialbrecht andialbrecht added this to the 0.5.0 milestone Oct 12, 2023
@andialbrecht
Copy link
Owner

It's been a while since I last worked with an Oracle database, but some backends had the same requirement IIRC.

@Bisk1
Copy link
Author

Bisk1 commented Oct 20, 2023

@andialbrecht do you plan next release any time soon? this enhancement would unblock a bugfix in Airflow

@MikeWallis42
Copy link

@andialbrecht following up on this one, do you have a release data in mind for 0.5.0?

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

When branches are created from issues, their pull requests are automatically linked.

3 participants