A collection of framework specific utilities for working with Supabase.
Project description
supabase-utils
A collection of framework specific utilities for working with Supabase.
Installation
pip supabase-utils
Usage
from sb_utils import sb_table
accounts = sb_table("accounts").select("id, title, created_by(username)", count="exact")
for account in accounts.data:
print(account.get("title"))
from pydantic import BaseModel
from sb_utils import BaseService
class User(BaseModel):
__tablename__ = "users"
id: Optional[str] = Field(default=None, primary_key=True)
username: str
class Account(BaseModel):
__tablename__ = "accounts"
id: Optional[str] = Field(default=None, primary_key=True)
title: str
created_by: User = Field(related_name="username")
class AccountService(BaseService):
model = Account
accounts = AccountService.all()
for account in accounts:
print(account.title)
Documentation
Community
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sb_utils-0.1.1.tar.gz
(1.9 kB
view hashes)