Skip to content

BaseSBModel

BaseSBModel

Bases: BaseModel, ABC

Base model for Supabase tables.

db_client classmethod

db_client() -> Type[BaseClient]

Get the database client class for the model. It can be overridden in the model class.

Returns:

Type Description
Type[BaseClient]

The database client class.

delete

delete() -> None

Delete the model instance from the database if it has an ID. Otherwise, do nothing.

save

save() -> Self

Save the model instance to the database. If the instance has an ID, it will be updated. Otherwise, it will be inserted.

Returns:

Type Description
Self

The saved model instance.