add keypair to transactkey
This commit is contained in:
@@ -312,12 +312,14 @@ class TransactKey:
|
||||
pk: str
|
||||
pairs: tuple[KeyPair, ...] = ()
|
||||
|
||||
def __add__(self, other: SortKey) -> 'TransactKey':
|
||||
def __add__(self, other: SortKey | KeyPair) -> 'TransactKey':
|
||||
if not isinstance(other, SortKey):
|
||||
raise TypeError('Can only add a SortKey to a TransactKey')
|
||||
|
||||
pair = KeyPair(self.pk, other)
|
||||
return TransactKey(pk=self.pk, pairs=self.pairs + (pair,))
|
||||
if isinstance(other, SortKey):
|
||||
other = KeyPair(self.pk, other)
|
||||
|
||||
return TransactKey(pk=self.pk, pairs=self.pairs + (other,))
|
||||
|
||||
|
||||
class TransactionCanceledReason(TypedDict):
|
||||
@@ -756,6 +758,7 @@ class DynamoDBCollection:
|
||||
"""
|
||||
DynamoDBCollection provides a high-level abstraction for performing common
|
||||
CRUD operations and queries on a DynamoDB table.
|
||||
|
||||
It leverages an underlying persistence layer to handle
|
||||
serialization and deserialization of data, key composition, transaction operations,
|
||||
and TTL management.
|
||||
@@ -765,7 +768,7 @@ class DynamoDBCollection:
|
||||
- Insert (put) items with optional TTL (time-to-live) settings.
|
||||
- Delete items based on keys and conditions.
|
||||
- Query items using partition keys or composite key pairs with
|
||||
optional filtering and pagination.
|
||||
optional filtering and pagination.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
|
||||
Reference in New Issue
Block a user