msgspec
msgspec copied to clipboard
Allowing For DeclarativeBases or other ways of working with msgspec.Structs directly with SQLAlchemy
Description
I asked the sqlalchemy devs what they thought would be the smartest ideas for merging SQLAlchemy with this library would be and I am waiting to hear back about some of what I was able to do and I already figured out a way to turn the attributes into an InstrumentedAttribute by using the Meta Variable however I wanted to see if there was anything you could do to make it so that I wouldn't need to write a class twice because if I'm going to be honest, It's kinda redundant. If we could find a way to solve mappers in msgspec or SQLAlchemy we would theoretically have a faster library than SQLModel/Pydantic altogether, and I see that performance would improve in things such as apis and servers.
Luckily for all of you as well I also code in C as well as Cython so I would be able to make changes myself if needed but feel free to let me know what your ideas would be to approach this problem going further. The library where I am doing everything is called SQLTable. incase reviewing that code is required as I already figured out how to translate SQLAlchemy and msgspec types but it seems SQLAlchemy requires a bit more in-deph merging which is why I am throwing this issue/request up. I see it's demand and I am excited to pursue these goals.