Using SQLAlchemy, an Engine object is created like this:
from sqlalchemy import create_engine
engine = create_engine("postgresql://localhost/mydb")
Accessing engine
fails if the database specified in the argument to create_engine
(in this case, mydb
) does not exist. Is it possible to tell SQLAlchemy to create a new database if the specified database doesn't exist?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…