A DRY ORM Implementation for Reusable CRUD Operations #1279
emekadefirst
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been using FastAPI and SQLModel to build backend APIs, and I really love the flexibility of being able to use natural Python typings, along with its default async functionality. The same goes for SQLModel — it's simple, intuitive, and powerful.
However, recently, while working with SQLModel, I found myself repeating the same pattern over and over again whenever creating a session for CRUD operations. It became quite repetitive and inefficient. The need for writing boilerplate code for each table’s CRUD operations was frustrating, and I realized there must be a better way.
So, I came up with OrmI — a DRY (Don’t Repeat Yourself) program that abstracts the session creation and CRUD logic into reusable, generic classes. This allows me to focus on the core logic of my app without having to manually set up sessions and repeat CRUD functions every time. The goal was to streamline backend development with a flexible, easy-to-use structure that works seamlessly with SQLModel and FastAPI.
👉https://github.com/emekadefirst/OrmI
Beta Was this translation helpful? Give feedback.
All reactions