Exemplo n.º 1
0
    class Model(new_base()):
        id = Column(UUID, hash_key=True)
        other = Column(DateTime, range_key=True)
        another = Column(UUID)
        last = Column(String)

        by_last = GlobalSecondaryIndex(hash_key="another", range_key="last")
        by_another = LocalSecondaryIndex(range_key="last")
Exemplo n.º 2
0
class MixinBase(BaseModel, UUIDHashKey, CreatedRangeKey):
    class Meta:
        abstract = True

    email = Column(String)
    updated = Column(DateTime)
    active = Column(Boolean)
    by_created = LocalSecondaryIndex(projection="all",
                                     range_key=CreatedRangeKey.created)
Exemplo n.º 3
0
class ProjectedIndexes(BaseModel):
    h = Column(Integer, hash_key=True)
    r = Column(Integer, range_key=True)
    both = Column(String)
    neither = Column(String)
    gsi_only = Column(String)
    lsi_only = Column(String)

    by_gsi = GlobalSecondaryIndex(hash_key="h", projection=["both", "gsi_only"])
    by_lsi = LocalSecondaryIndex(range_key="r", projection=["both", "lsi_only"])
Exemplo n.º 4
0
class ComplexModel(BaseModel):
    class Meta:
        write_units = 2
        read_units = 3
        table_name = "CustomTableName"

    name = Column(UUID, hash_key=True)
    date = Column(String, range_key=True)
    email = Column(String)
    joined = Column(String)
    not_projected = Column(Integer)
    by_email = GlobalSecondaryIndex(hash_key="email", read_units=4, projection="all", write_units=5)
    by_joined = LocalSecondaryIndex(range_key="joined", projection=["email"])
Exemplo n.º 5
0
 class Model(new_base()):
     id = Column(UUID, hash_key=True)
     another = Column(UUID)
     by_another = LocalSecondaryIndex(range_key="another")
Exemplo n.º 6
0
 class InvalidIndex(new_base()):
     id = Column(UUID, hash_key=True)
     index = LocalSecondaryIndex(range_key="id")