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

Future of this integration #180

Open
patrick91 opened this issue Jun 12, 2024 · 10 comments
Open

Future of this integration #180

patrick91 opened this issue Jun 12, 2024 · 10 comments

Comments

@patrick91
Copy link
Member

patrick91 commented Jun 12, 2024

Hi folks!

I wanted to write something I was discussing with @bellini666 a few weeks ago, at the moment we don't really have a maintainer for this library, I think @mattalbr is quite busy with his work, so we were wondering if we need to do a call for maintainers (if you, reading this, are interested let us know!)

Additionally we were thinking about how we can converge the integrations a bit, Strawberry Django has a lot of features that can be reuse/reimplemented here, but I think some of the APIs are different, maybe there's an opportunity to update this library to have a similar API to strawberry django (of course trying to prevent breaking changes if possible)

What do you think? /cc @erikwrede

@patrick91 patrick91 pinned this issue Jun 12, 2024
@bellini666
Copy link
Member

Additionally we were thinking about how we can converge the integrations a bit, Strawberry Django has a lot of features that can be reuse/reimplemented here, but I think some of the APIs are different, maybe there's an opportunity to update this library to have a similar API to strawberry django (of course trying to prevent breaking changes if possible)

Would love to move the "agnostic" pieces of strawberry django to strawberry itself, which could benefit not only this integration, but maybe pydantic's as well and others to come

@Philaeux
Copy link

What are the options for someone using SQLAlchemy and Strawberry? To my knowledge:

  • Write Strawberry type and SQLAchemy classes, make the binding by hand.
  • Use this library to generate the strawberry types from SQLAlchemy classes. After using it extensively, it feels a bit hacky (the way to plug the mapper). Moreover, the lib doesn't have a lot of support. This issue SQLAlchemy Relationships fail when using secondary Table #19 is still around on version 0.4.3 and is stopping any upgrades.
  • I discovered recently this new lib SQLModel that binds SQLalchemy to Pydantic models, writting the class one time only. I havn't tested yet if it works nicely with alembic but also if the Strawberry Pydantic extension works on it. It could be a alternative.

Are there any other way?

@Ckk3
Copy link
Contributor

Ckk3 commented Sep 3, 2024

Hi folks!

I wanted to write something I was discussing with @bellini666 a few weeks ago, at the moment we don't really have a maintainer for this library, I think @mattalbr is quite busy with his work, so we were wondering if we need to do a call for maintainers (if you, reading this, are interested let us know!)

Additionally we were thinking about how we can converge the integrations a bit, Strawberry Django has a lot of features that can be reuse/reimplemented here, but I think some of the APIs are different, maybe there's an opportunity to update this library to have a similar API to strawberry django (of course trying to prevent breaking changes if possible)

What do you think? /cc @erikwrede

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.

Fund with Polar

Hi, I can dedicate some time of my week to work on this library as a maintainer, I already have some contributions to this project. I'm currently a mid-level django developer, if its is okay, please fell free to contact me! I'm already on discord server as @gustavom0ta

@bellini666
Copy link
Member

@Ckk3 hey :)

Sorry for taking long to comment here. We indeed would appreciate some help with this lib. Let's chat! :)

Ping me on Discord. If sending a PM you can speak Portuguese with me, I'm also Brazilian 😊

@Ckk3
Copy link
Contributor

Ckk3 commented Sep 24, 2024

@Ckk3 hey :)

Sorry for taking long to comment here. We indeed would appreciate some help with this lib. Let's chat! :)

Ping me on Discord. If sending a PM you can speak Portuguese with me, I'm also Brazilian 😊

Hi! It's okay don't worry, I'm gonna send a friend request to you!

@mattalbr
Copy link
Contributor

Hi all, sorry, I have indeed been completely MIA. It's awesome to see all the interest shown here to keep this library going.

Patrick correctly guessed that I've been extremely busy, and I won't have a ton of cycles to devote here, but I'd like to contribute where I can to keep this project moving forward in a good direction.

For now, as the absolute bare minimum, I sent out a PR to unblock upgrading strawberry. I think it's probably blocked on @Ckk3 's PR fixing our CI

I'll also make sure emails for this repo get properly sent to my work email, where I'm much more responsive than my personal email.

@fruitymedley
Copy link
Contributor

Hi, I wanted to hop on this thread and express my interest in getting involved with maintenance as well. I tried contributing some last year, though I ultimately got sidetracked.

@Ckk3
Copy link
Contributor

Ckk3 commented Feb 10, 2025

Hi, I wanted to hop on this thread and express my interest in getting involved with maintenance as well. I tried contributing some last year, though I ultimately got sidetracked.

Hi, @fruitymedley I appreciate your interest, it would be great to have your help!

Please check out the Strawberry Discord Server, that’s where we communicate with the Strawberry team. I’ve also reached out to the contributors team to talk with you later about your interest.

@gazorby
Copy link

gazorby commented Mar 19, 2025

Hello everyone!

I just released strawchemy, a new sqlalchemy-strawberry integration that is already in use for a work project.

I originally used Hasura for this project, but found it too cumbersome to configure and deploy, and the micro-service design limits resolver implementation and schema customization.

So I started working on something that would provide the same out-of-the-box powerful and performant GraphQL API, but with more schema flexibility that would not restrict me in edge cases.

Here are the currently implemented features:

  • Automatic generation of Strawberry types from SQLAlchemy models: handle columns, relationships, and reference cycles, without the need for a naming convention
  • Auto resolvers that translate GraphQL queries into natural, efficient SQL queries, selecting only the queried GraphQL fields and using joins instead of subqueries for relationships
  • Extensive filtering on most data types, including JSON, ARRAY, and Postgis geometry
  • Aggregation queries and filtering
  • Offset-based pagination
  • Support for sync and async contexts

And more to come! (especially mutations, so we could have full CRUD support)

Usage is similar to the Django integration, with slight differences in how filtering and pagination are enabled.

As for reusable components, the type mapping system in strawchemy exposes a standard interface for retrieving ORM model fields. This is the backbone of type/input generation, and while only the SQLAlchemy interface is implemented, it should be possible to add other ORM integrations, such as SQLModel (since it uses SQLAlchemy under the hood).

Anyway, let me know what you think!

@Ckk3
Copy link
Contributor

Ckk3 commented Mar 20, 2025

Hello everyone!

I just released strawchemy, a new sqlalchemy-strawberry integration that is already in use for a work project.

I originally used Hasura for this project, but found it too cumbersome to configure and deploy, and the micro-service design limits resolver implementation and schema customization.

So I started working on something that would provide the same out-of-the-box powerful and performant GraphQL API, but with more schema flexibility that would not restrict me in edge cases.

Here are the currently implemented features:

  • Automatic generation of Strawberry types from SQLAlchemy models: handle columns, relationships, and reference cycles, without the need for a naming convention
  • Auto resolvers that translate GraphQL queries into natural, efficient SQL queries, selecting only the queried GraphQL fields and using joins instead of subqueries for relationships
  • Extensive filtering on most data types, including JSON, ARRAY, and Postgis geometry
  • Aggregation queries and filtering
  • Offset-based pagination
  • Support for sync and async contexts

And more to come! (especially mutations, so we could have full CRUD support)

Usage is similar to the Django integration, with slight differences in how filtering and pagination are enabled.

As for reusable components, the type mapping system in strawchemy exposes a standard interface for retrieving ORM model fields. This is the backbone of type/input generation, and while only the SQLAlchemy interface is implemented, it should be possible to add other ORM integrations, such as SQLModel (since it uses SQLAlchemy under the hood).

Anyway, let me know what you think!

Congratulations on the release of strawchemy, @gazorby ! 🎉 It’s exciting to see new contributions to the SQLAlchemy and Strawberry ecosystem.

Looking forward to seeing how this evolves, especially with mutation support 👀

Thanks for sharing this with the community, and great work! 🚀

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

7 participants