polars
polars copied to clipboard
rust-polars SQL read and write
pandas as py-polars seem to have read_sql
methods allowing reading tables into a dataframe.
Would it be possible for rust polars to also allow reading of sql query results into a dataframe and also to insert dataframe rows to the database?
It could use an integration with sqlx
to allow support with many types of database.
This would be similar to pandas.to_sql
Related: https://github.com/pola-rs/polars/issues/2994. Note that connectorx
(which polars.read_sql
can use) does have a Rust query API: https://docs.rs/connectorx/latest/connectorx/
What is the status of this request please?
Is there no way of reading from a SQL server into a DF? In python I made a ODBC connection and used that to make a DF. One would think I could do the same thing in the RUST version...
hey, I have a similar requirement. Currently I use odbc-api to get data from an DB2 (IBM i) database . I tried to use arrow-odbc but I didn't find a way to create a polars DataFrame from arrow RecordBatch. It would be really nice if some thing like the python from_arrow function could be implemented in the Rust API. Or maybe I didn't find a simple way to do it? Thanks and Cheers!
I just wanted to check in on this. Is there work already underway on this? I'd be more than happy to help if this would be a welcome contribution.
I can't live without pandas.read_sql so this is something I would love to see in the Rust API.
Hi, here is my current solution with arrow_odbc, arrow, polars_arrow. https://github.com/pacman82/odbc-api/discussions/536#discussioncomment-8807348
I found the arrow RecordBatch to DataFrame code hiere: https://stackoverflow.com/questions/78084066/arrow-recordbatch-as-polars-dataframe