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

[Feature Req] Supporting or splitting multiple queries #65

Open
athewsey opened this issue Jun 29, 2023 · 1 comment
Open

[Feature Req] Supporting or splitting multiple queries #65

athewsey opened this issue Jun 29, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@athewsey
Copy link

Hi & thanks for a nice library!

I understood from the README that:

The query command accepts a single query only. If you need to send multiple queries, just call the method multiple times.

...However, I'm currently working on a use-case where the query source is coming from a previously authored .sql script file and splitting the statements is not a trivial task!

Consider for example the pagila sample schema upload SQL: Identifying statements is much more complex than simply splitting on ;, because of factors like commented-out semicolons and user-defined functions which include semicolons in their bodies.

It would be great if, even if this project doesn't want to take on multi-statement query support, we were able to provide guidance on how to tackle the splitting in the README. For now I've not yet found a reliable way to do it.

@malthe
Copy link
Owner

malthe commented Jun 30, 2023

I think it's doable, but I wonder to what extent it has to be tailored to each dialect of SQL. To constructs have multiple statements appearing inside of a BEGIN/END block for example.

@malthe malthe added the enhancement New feature or request label Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants