Skip to content

Commit

Permalink
fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
chennisden committed May 30, 2024
1 parent 0638c97 commit 0de6e16
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions store/app/api/crud/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion store/app/api/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 0de6e16

Please sign in to comment.