How to set default schema through URL in SQLAlchemy.create_engine for postgresql

185 views Asked by At

I tried to make a python models for my flask application with sqlacodegen .

and my database is postgresql in AWS_RDS .

so I tried like below

sqlacodegen postgresql://{RDS_USERNAME}:{RDS_PASSWORD}@{RDS_HOSTNAME}:{RDS_PORT}/{RDS_DB_NAME}'

but it just works with my default schema in postgresql RDS_DB_NAME

I want information of other schemas which are not set as default TT.

1

There are 1 answers

0
runRyan On BEST ANSWER

I Solved!!

I found that sqlacodegen has args option --schema

So, I made a commend as below

sqlacodegen --schema public_test URL