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

Any way to execute commands prior to query? #654

Open mcrumiller opened 1 week ago

mcrumiller commented 1 week ago

I need to be able to execute a command prior to sql query, as in the following:

set optimizer = 'on';
SELECT * FROM my_table;

Since connectorx creates and destroys a new connection upon each query, is there any way to supply a set of execute instructions prior to the query that are session-specific?

surister commented 1 week ago

There is currently no:

You can manually pass the queries to read_sql but you'd have to take care of the partitions yourself