Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allowing For DeclarativeBases or other ways of working with msgspec.Structs directly with SQLAlchemy #808

Open
Vizonex opened this issue Jan 27, 2025 · 1 comment

Comments

@Vizonex
Copy link

Vizonex commented Jan 27, 2025

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.

@Vizonex Vizonex changed the title Allowing For DeclaratibeBases or other ways of working with msgspec.Structs directly with SQLAlchemy Allowing For DeclarativeBases or other ways of working with msgspec.Structs directly with SQLAlchemy Jan 27, 2025
@Vizonex
Copy link
Author

Vizonex commented Mar 3, 2025

I'm going to make a new issue because many of my problems were solved however sqlalchemy's Mapped[] variables for json decoding are being an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant