Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I write a Polars dataframe to an external database?

I have a Polars dataframe that I want to write to an external database (SQLite). How can I do it?

In Pandas you have to_sql() but I couldn't find any equivalent in Polars.

like image 748
Shahar Luftig Avatar asked Sep 14 '25 18:09

Shahar Luftig


1 Answers

You can use the DataFrame.write_database method.

like image 105
ritchie46 Avatar answered Sep 17 '25 09:09

ritchie46