sfu-db / connector-x

Fastest library to load data from DB to DataFrames in Rust and Python
https://sfu-db.github.io/connector-x
MIT License
1.94k stars 154 forks source link

Support SQL ending with a semicolon #575

Closed theelderbeever closed 5 months ago

theelderbeever commented 7 months ago

Describe your feature request

Currently, you can't submit queries that terminate with a semicolon. It would be nice to be able to able to include these. Primary reasons being that it is part of the standard already and a lot of syntax highlighters trigger off of the ; to stop highlighting.

image
Jordan-M-Young commented 6 months ago

Hey @theelderbeever,

I think this should simple as adding a few well placed query.replace(";","") statements here.

Happy to take a look at this when I have a chance.

theelderbeever commented 6 months ago

@Jordan-M-Young Awesome and greatly appreciated!

aimtsou commented 6 months ago

Good afternoon,

I have written some code which i think it fixes the problem, I am not sure though if we need to write some extra tests for that because the behavior for the tests should not change.

What do you think @theelderbeever

theelderbeever commented 6 months ago

@aimtsou do you have a branch or something that I can look at?

aimtsou commented 6 months ago

@aimtsou do you have a branch or something that I can look at?

https://github.com/aimtsou/connector-x/blob/aimilios_semicolon/connectorx-python/connectorx/__init__.py Lines 207-212

On a note, I can remove striping to preserve the original content. I need to think of that

Jordan-M-Young commented 5 months ago

@theelderbeever Just merged this PR Hopefully things are good to go now