Spaces:
Sleeping
Sleeping
File size: 575 Bytes
5b9551b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
from supabase import create_client
from typing import Optional
from functools import lru_cache
from dotenv import load_dotenv
from pydantic import BaseModel
load_dotenv()
import os
@lru_cache(maxsize=1)
class Supabase_Settings(BaseModel):
SUPABASE_URL: str = os.getenv("SUPABASE_URL")
SUPABASE_ANON_KEY: str = os.getenv("SUPABASE_ANON_KEY")
SUPABASE_SERVICE_KEY: str = os.getenv("SUPABASE_SERVICE_KEY")
@lru_cache(maxsize=1)
class Supabase_Client:
values = Supabase_Settings()
instance = create_client(values.SUPABASE_URL, values.SUPABASE_SERVICE_KEY) |