diff --git a/store/app/api/crud/base.py b/store/app/api/crud/base.py index 08c90e0b..bc7cf131 100644 --- a/store/app/api/crud/base.py +++ b/store/app/api/crud/base.py @@ -30,12 +30,20 @@ async def __aexit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None: # if self.__db is not None: await self.__db.__aexit__(exc_type, exc_val, exc_tb) + """Creates a table in the Dynamo database. + + Args: + name: Name of the table. + keys: Primary and secondary keys. Do not include non-key attributes. + gsis: Making an attribute a GSI is required in oredr to query against it. + Note HASH on a GSI does not actually enforce uniqueness. + Instead, the difference is: you cannot query RANGE fields alone but you may query HASH fields + deletion_protection: Whether the table is protected from being deleted. + """ async def _create_dynamodb_table( self, name: str, keys: list[tuple[str, Literal["S", "N", "B"], Literal["HASH", "RANGE"]]], - # It turns out having HASH on a GSI does not actually enforce uniqueness. - # Instead, the difference is: you cannot query RANGE fields alone but you may query HASH fields gsis: list[tuple[str, str, Literal["S", "N", "B"], Literal["HASH", "RANGE"]]] = [], deletion_protection: bool = False, ) -> None: diff --git a/store/app/api/model.py b/store/app/api/model.py index 88a5cae3..f3fc1004 100644 --- a/store/app/api/model.py +++ b/store/app/api/model.py @@ -17,7 +17,7 @@ class User(BaseModel): class Token(BaseModel): # Email of the user the token belongs to email: str - # Id of the token itself, not the user it belongs to. + # ID of the token itself, not the user it belongs to. id: str issued: Decimal = field(default_factory=lambda: Decimal(datetime.datetime.now().timestamp())) disabled: bool = field(default=False)