Using object-relational mappers
An object-relational mapper (ORM) is a piece of software that tries to handle the ‘impedance mismatch’ between the relational database model and the object-oriented paradigm (https://en.wikipedia.org/wiki/Object%E2%80%93relational_impedance_mismatch). Since its first iterations ORMs have been the center of heated debates, Martin Fowler some time ago writing a great piece on the general landscape that is still valuable today (https://martinfowler.com/bliki/OrmHate.html). In the Python world the use of ORMs is common; Figure 8.3 summarizes their capabilities:

Figure 8.3: ORM general model
We are not going to argue the pros and cons of ORMs in depth, but notice that there are, as with many other projects in the ecosystem, several implementations that provide differing levels of asynchronous support. The main advantages provided by ORMs include:
- Reduction of SQL code, allowing development with unified Python code ...