Execute raw SQL queries in SQLAlchemy


Python SQLAlchemy tip:

You can use raw queries while still using SQLAlchemy models.

For example

user = session.query(Course).from_statement(
    text("""SELECT * FROM courses where title=:title""")
).params(title="Scalable FastAPI Applications on AWS").all()