Replies: 1 comment
-
Surel. I've been experimenting with Reflex. Let's assume you have a SQL database. Refex's database ORM are built around SQLModel. So you could access your database with your database models in Reflex. You could then have another app that uses SQLModel and independently access the same database. I've only used Reflex with SQLlite and it's very simple to set up. I haven't tried it with a full fledged database. I've done something similar with Flask and FastAPI where both independently accessed SQL Server. I used SqlAlchemy in that situation. I found that I needed to tweak the model definitions due to some differences in how I configured the ORM connections but otherwise they work fine. SQLModel is an abstraction to simplify SQLAlchemy so there's a good chance it will require less tweaking. Let us know how it turns out. |
Beta Was this translation helpful? Give feedback.
-
I have been checking out Reflex as a potential framework for a new project.
I defined the model classes for my existing database in a models.py as per various examples.
I currently fill the database through external means using the normal python mariadb client and executing sql directly.
The main thing I want from a framework is to be able to reuse the database connectivity and ORM.
Is it possible to reuse the models I created for the Reflex app in normal python scripts?
If so, could someone give me a minimal example on how to do this?
Beta Was this translation helpful? Give feedback.
All reactions