Skip to content
Discussion options

You must be logged in to vote

FastAPI is huge on dependency injection, you should be using Depends in the endpoint you will pass this function into.

from fastapi import Depends
from api.supabase_client import create_supabase, Client

@app.get("/")
async def home(
    supabase: Client = Depends(create_supabase),
):
  response = (
    await supabase.table("tbl").select("*").execute()
  )
  return response

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Spritan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants