SQLAlchemy is quite popular ORM in Python commonly used with Flask applications. SQLAlchemy has even a special version Flask-SQLAlchemy.

There is many tutorials on using SQLAlchemy in context of Flask application. However sometimes we need only to verify whether our data model created using SQLAlchemy ORM works as it’s expected and don’t want to create a Flask app for this purpose. Here I will show how to test a simple data model without creating a Flask app. We will use extremely simple scripts with few lines of code to migrate existing data model to database and perform simple queries.


Privalov Vladimir

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store