OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

How to execute raw SQL in Flask-SQLAlchemy app

  • Thread starter Thread starter starwing123
  • Start date Start date
S

starwing123

Guest
How do you execute raw SQL in SQLAlchemy?

I have a python web app that runs on flask and interfaces to the database through SQLAlchemy.

I need a way to run the raw SQL. The query involves multiple table joins along with Inline views.

I've tried:

Code:
connection = db.session.connection()
connection.execute( <sql here> )

But I keep getting gateway errors.
<p>How do you execute raw SQL in SQLAlchemy?</p>

<p>I have a python web app that runs on flask and interfaces to the database through SQLAlchemy. </p>

<p>I need a way to run the raw SQL. The query involves multiple table joins along with Inline views. </p>

<p>I've tried:</p>

<pre><code>connection = db.session.connection()
connection.execute( <sql here> )
</code></pre>

<p>But I keep getting gateway errors.</p>
 

Latest posts

Top