From SQL to SQLModel: A Cleaner Way to Work with Databases in Python

SQLModel is a library that lets you interact with databases through Python code with Python objects and type annotations instead of writing direct SQL queries. Created by the same author of the extremely popular framework FastAPI, it aims to make interacting with SQL DBs in Python easier and elegant, with data validation and IDE support,… Continue reading From SQL to SQLModel: A Cleaner Way to Work with Databases in Python

What is the Repository Pattern and How to Use it in Python?

The repository pattern is a design pattern that helps you separate business logic from data access code. It does so by providing a unified interface for interacting with different data sources, bringing the following advantages to your system: A practical example Let’s use Python and sqlmodel (PyPI) to demonstrate this pattern (code here): Note: In this implementation,… Continue reading

What is the Repository Pattern and How to Use it in Python?