Chapter 2. Creating Models with SQLAlchemy

As previously stated, models are a means of abstracting and giving a common interface to data. In most web applications, data is stored and retrieved from a Relational Database Management System (RDBMS), which is a database that holds data in a tabular format with rows and columns and is able to compare data across tables. Some examples include MySQL, Postgres, Oracle, and MSSQL.

In order to create models on top of our database, we will use a Python package named SQLAlchemy. SQLAlchemy is a database API at its lowest level and performs Object Relational Mapping (ORM) at its highest level. An ORM is a technique to pass and convert data between two sources with different types of systems and data structures. ...

Get Mastering Flask now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.