Skip to content

Instantly share code, notes, and snippets.

@jeakwon
Created April 20, 2020 11:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeakwon/caf6e586c388310e1856c2cc76b4f735 to your computer and use it in GitHub Desktop.
Save jeakwon/caf6e586c388310e1856c2cc76b4f735 to your computer and use it in GitHub Desktop.
import pandas as pd
from sqlalchemy import create_engine
engine = create_engine('postgresql://id:password@localhost:port/database')
df.to_sql('table_name', engine)
pd.read_sql("select * from users limit 1", engine)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment