Upsert records into the database. Args: keys: A list of record keys to upsert. group_ids: A list of group IDs corresponding to the keys. time_at_least: Optional timestamp. Implementation can use this to optionally verify that the timestamp
(
self,
keys: Sequence[str],
*,
group_ids: Optional[Sequence[Optional[str]]] = None,
time_at_least: Optional[float] = None,
)
| 83 | |
| 84 | @abstractmethod |
| 85 | def update( |
| 86 | self, |
| 87 | keys: Sequence[str], |
| 88 | *, |
| 89 | group_ids: Optional[Sequence[Optional[str]]] = None, |
| 90 | time_at_least: Optional[float] = None, |
| 91 | ) -> None: |
| 92 | """Upsert records into the database. |
| 93 | |
| 94 | Args: |
| 95 | keys: A list of record keys to upsert. |
| 96 | group_ids: A list of group IDs corresponding to the keys. |
| 97 | time_at_least: Optional timestamp. Implementation can use this |
| 98 | to optionally verify that the timestamp IS at least this time |
| 99 | in the system that stores the data. |
| 100 | |
| 101 | e.g., use to validate that the time in the postgres database |
| 102 | is equal to or larger than the given timestamp, if not |
| 103 | raise an error. |
| 104 | |
| 105 | This is meant to help prevent time-drift issues since |
| 106 | time may not be monotonically increasing! |
| 107 | |
| 108 | Raises: |
| 109 | ValueError: If the length of keys doesn't match the length of group_ids. |
| 110 | """ |
| 111 | |
| 112 | @abstractmethod |
| 113 | async def aupdate( |
no outgoing calls
no test coverage detected