[Python] Connect to AWS RDS with sqlalchemy and get tables

jua·2021년 12월 6일
0

SQL-python

목록 보기
1/3
from sqlalchemy import create_engine, Table, MetaData

url = "{AWS rds db url: postgresql://{user}:{password}@{rds endpoint}:{port}/{DB name}}"

engine = create_engine(url)
connect = engine.connect()
meta = MetaData()

table = Table(name='{table_name}', 
              metadata=meta, 
              autoload_with=connect, 
              postgresql_ignore_search_path=True)
profile
AI/ML engineer

0개의 댓글