CacheClient
CacheClient
¶
CacheClient(table_name: str)
Bases: BaseClient
Client for caching data in memory.
bulk_delete
¶
bulk_delete(*, ids: Iterable[int]) -> List[Dict[str, Any]]
Bulk delete records in 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]]
|
The 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 record to update. |
required |
data |
Data[str, Any]
|
The updated data. |
required |
Returns:
Type | Description |
---|---|
List[str, Any]
|
The 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 |
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
The updated record. |