You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some DBMS support the use of temporary tables. These are tables that only exist within a session and get dropped at the end of a session. These tables are useful for storing intermediary results in longer ETL jobs or for uploading a list of IDs into a otherwise read-only database for further processing. They are created with a CREATE TEMPORARY TABLE statement. At the moment, the to_sql method does not support creating temporary tables or inserting values into a manually created temporary table. At its core, to_sql uses the sqlalchemy.Table class , which supports a parameter prefixes. This parameter inserts a list of keywords before the TABLE keyword and can be used to create temporary tables by setting prefixes=["TEMPORARY"]. I suggest to add a prefixes parameter to to_sql and pass it down to the sqlalchemy.Table.
Feature Type
Adding new functionality to pandas
Changing existing functionality in pandas
Removing existing functionality in pandas
Problem Description
Some DBMS support the use of temporary tables. These are tables that only exist within a session and get dropped at the end of a session. These tables are useful for storing intermediary results in longer ETL jobs or for uploading a list of IDs into a otherwise read-only database for further processing. They are created with a
CREATE TEMPORARY TABLE
statement. At the moment, theto_sql
method does not support creating temporary tables or inserting values into a manually created temporary table. At its core,to_sql
uses thesqlalchemy.Table
class , which supports a parameterprefixes
. This parameter inserts a list of keywords before theTABLE
keyword and can be used to create temporary tables by settingprefixes=["TEMPORARY"]
. I suggest to add aprefixes
parameter toto_sql
and pass it down to thesqlalchemy.Table
.Feature Description
Add a parameter
prefixes
to theto_sql
method:The parameter needs to work with all possible ways of
if_exists
, so you can switch betweenCREATE TEMPORARY TABLE
andINSERT
functionality.Alternative Solutions
Thus far, I was not able to find another solution.
Additional Context
I'm already working on a suitable implementation of the feature: #60409
The text was updated successfully, but these errors were encountered: