Skip to content

Adding DuckDB as a SQL Database for the to_sql() function #45675

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 11 commits into from

Conversation

pdet
Copy link

@pdet pdet commented Jan 28, 2022

This PR adds DuckDB as a direct possibility to the to_sql() function.
It basically uses DuckDBs internal pandas integration to load data frames as a duckdb table.

I think I've added duckdb correctly as an optional dependency, I'm happy to fix it if I made any mistake :-)

I'm also really supporting the optional if_exists attribute, if any other attribute is a 'must-have' I'm also happy to do so.

@alimcmaster1
Copy link
Member

Hey, thanks for the PR, DuckDb looks interesting. Might be worth opening an issue + getting agreement from core team that this is something we want to support before continuing dev here

Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I commented on your created issue as well, but noted in #45678 (comment) that it would be great to have a SQL engine interface to implement Duck DB instead of having Duck DB specific code here

@jreback jreback added the IO SQL to_sql, read_sql, read_sql_query label Jan 29, 2022
@jreback
Copy link
Contributor

jreback commented Jan 29, 2022

agree with @mroeschke recommendations here.

@mroeschke
Copy link
Member

Thanks for the pull request, but as mentioned, in #45678 (comment), pandas would need to support a DB engine interface first before supporting DuckDB directly. Closing for now, but happy to have progress on the interface!

@mroeschke mroeschke closed this Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO SQL to_sql, read_sql, read_sql_query
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants