Skip to content

Instantly share code, notes, and snippets.

@khuyentran1401
Created August 7, 2022 14:09
Show Gist options
  • Save khuyentran1401/38e3238877242b757ab61555662e92d5 to your computer and use it in GitHub Desktop.
Save khuyentran1401/38e3238877242b757ab61555662e92d5 to your computer and use it in GitHub Desktop.
from sqlalchemy import create_engine
engine = create_engine(
f"postgresql://{connection.user}:{connection.password}@{connection.host}/{connection.database}",
)
df.to_sql(name=name, con=engine, if_exists="replace", index=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment