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

Async support #604

Closed
AtticusZeller opened this issue Oct 29, 2023 · 4 comments
Closed

Async support #604

AtticusZeller opened this issue Oct 29, 2023 · 4 comments

Comments

@AtticusZeller
Copy link

i published supabase-py-async package
on pypi,if u wanna try ,pip install supabase-py-async!😊

@AtticusZeller
Copy link
Author

Hey everyone! 🌟 I've been diving deep into the community version of Supabase py and noticed a few areas that could use some tweaks. To address this, I've made some adjustments in my own repository, and I'd love for you to give it a try! Especially designed with FastAPI in mind, this revised version aims to enhance efficiency and compatibility.You know how Supabase js is crafted for frontend use, right? Well, I realized that the existing Supabase py is essentially a mirror of this js version, which doesn't quite fit the bill for Python web frameworks like FastAPI. In FastAPI, every request requires client instances, but I believe this approach isn't always necessary.My proposal? Let's introduce an 'auth clients dict' within the main async client. This way, we won't need to spawn excessive async clients. Instead, we can focus on auth clients, performing operations on Supabase through functions in the main async client (functions that will use the authclient with all the necessary info).I'm excited to collaborate and solve any bugs that might pop up. Let's work together to make the Supabase community even better! 😊 Feel free to join the discussion on GitHub and share your thoughts and suggestions!

@J0
Copy link
Contributor

J0 commented Nov 17, 2023

Hey @Atticuszz,

These sounds like good suggestions - if you haven't done so already do you mind tagging @silentworks on the discussion? He's currently most up to date with the Supabase Python/Web Frameworks story and would be the best person to chat with to upstream any changes. Alternatively you can reach him on Discord too.

Thanks!

@AtticusZeller
Copy link
Author

thanks,i'll do it right now 😄

@silentworks
Copy link
Contributor

silentworks commented Dec 1, 2023

We now have async support in the latest version 2.2.0 of supabase-py. You can use the async version in your code by doing:

from supabase._async.client import AsyncClient as Client, create_client

async def create_supabase() -> Client:
    return await create_client(url, key)

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

3 participants