Search code examples
pythonsqlitepython-polars

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.


Solution

  • You can use the DataFrame.write_database method.