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.85k stars 146 forks source link

Feat/pg semicolon support #599

Closed Jordan-M-Young closed 2 months ago

Jordan-M-Young commented 2 months ago

Implementing support for finishing postgres queries with a semicolon per this issue.

Changes include:

Jordan-M-Young commented 2 months ago

@wangxiaoying I think this one is ready for review. Let me know if/what changes are needed. Thanks in advance!

wangxiaoying commented 2 months ago

Hi @Jordan-M-Young , thanks for the PR!

I think my concern is that ';' may also appears in other parts of the query, such as string matching. For example: select s from t where s like '%abc;'. In this case, simply replace ";" with "" will change the semantic of the sql query.

I would suggest to only replace the ";" if it is the last valid character in the sql query. Such as select s from t; or select s from t;[spaces] but not select s from t where s like '%abc;'

Jordan-M-Young commented 2 months ago

@wangxiaoying Thanks for the suggestion. I believe my newest commit should allay that concern. If you wouldn't mind taking another look I'd appreciate it.

wangxiaoying commented 2 months ago

Thank you @Jordan-M-Young ! I have merged the PR.