Skip to content

SupabaseClient

SupabaseClient

SupabaseClient(table_name: str)

Bases: BaseClient

Client for Supabase.

bulk_delete

bulk_delete(*, ids: Iterable[int]) -> List[Dict[str, Any]]

Bulk delete records from the table.

Parameters:

Name Type Description Default
ids Iterable[int]

The IDs of the records to delete.

required

Returns:

Type Description
List[Dict[str, Any]]

List of deleted records.

bulk_update

bulk_update(*, ids: Iterable[int], data: Dict[str, Any]) -> List[Dict[str, Any]]

Bulk update records in the table.

Parameters:

Name Type Description Default
ids Iterable[int]

The IDs of the records to update.

required
data Dict[str, Any]

The data to update.

required

Returns:

Type Description
List[Dict[str, Any]]

List of updated records.

delete

delete(*, id: int) -> None

Delete a record from the table.

Parameters:

Name Type Description Default
id int

The ID of the record to delete.

required

insert

insert(data: Dict[str, Any]) -> Dict[str, Any]

Insert a new record into the table.

Parameters:

Name Type Description Default
data Dict[str, Any]

The data to insert.

required

Returns:

Type Description
Dict[str, Any]

The inserted record.

select

select(*, eq: Dict[str, Any] | None = None, neq: Dict[str, Any] | None = None) -> List[Dict[str, Any]]

Select records from the table.

Parameters:

Name Type Description Default
eq Dict[str, Any] | None

The equality filter.

None
neq Dict[str, Any] | None

The non-equality filter.

None

Returns:

Type Description
List[Dict[str, Any]]

The selected records.

update

update(*, id: int, data: Dict[str, Any]) -> Dict[str, Any]

Update a record in the table.

Parameters:

Name Type Description Default
id int

The ID of the record to update.

required
data Dict[str, Any]

The data to update.

required

Returns:

Type Description
Dict[str, Any]

The updated record.