Esempio n. 1
0
class SecondModel(Model):

    __table_name__ = "first_model"
    first_key = columns.UUID(primary_key=True)
    second_key = columns.UUID()
    third_key = columns.Text()
    fourth_key = columns.Text()
Esempio n. 2
0
class FourthModel(Model):

    __table_name__ = "first_model"
    first_key = columns.UUID(primary_key=True)
    second_key = columns.UUID()
    third_key = columns.Text()
    # renamed model field, but map to existing column
    renamed = columns.Map(columns.Text, columns.Text, db_field="blah")
Esempio n. 3
0
class ThirdModel(Model):

    __table_name__ = "first_model"
    first_key = columns.UUID(primary_key=True)
    second_key = columns.UUID()
    third_key = columns.Text()
    # removed fourth key, but it should stay in the DB
    blah = columns.Map(columns.Text, columns.Text)
Esempio n. 4
0
class ComplexModelRouting(Model):
    __table_name__ = "complex_model_routing"
    partition = columns.UUID(partition_key=True, default=uuid4)
    cluster = columns.Integer(partition_key=True)
    count = columns.Integer()
    text = columns.Text(partition_key=True)
    float = columns.Float(partition_key=True)
    text_2 = columns.Text()
Esempio n. 5
0
class TestModelSave(Model):

    partition = columns.UUID(primary_key=True, default=uuid4)
    cluster = columns.Integer(primary_key=True)
    count = columns.Integer(required=False)
    text = columns.Text(required=False, index=True)
    text_set = columns.Set(columns.Text, required=False)
    text_list = columns.List(columns.Text, required=False)
    text_map = columns.Map(columns.Text, columns.Text, required=False)
Esempio n. 6
0
class ModelWithTableProperties(Model):

    __options__ = {'bloom_filter_fp_chance': '0.76328',
                   'comment': 'TxfguvBdzwROQALmQBOziRMbkqVGFjqcJfVhwGR',
                   'gc_grace_seconds': '2063',
                   'read_repair_chance': '0.17985',
                   'dclocal_read_repair_chance': '0.50811'}

    key = columns.UUID(primary_key=True)
Esempio n. 7
0
class TestNestedModel(Model):

    partition = columns.UUID(primary_key=True, default=uuid4)
    list_list = columns.List(columns.List(columns.Integer), required=False)
    map_list = columns.Map(columns.Text,
                           columns.List(columns.Text),
                           required=False)
    set_tuple = columns.Set(columns.Tuple(columns.Integer, columns.Integer),
                            required=False)
Esempio n. 8
0
class ModelWithTableProperties(Model):

    __options__ = {
        "bloom_filter_fp_chance": "0.76328",
        "comment": "TxfguvBdzwROQALmQBOziRMbkqVGFjqcJfVhwGR",
        "gc_grace_seconds": "2063",
        "read_repair_chance": "0.17985",
        "dclocal_read_repair_chance": "0.50811",
    }

    key = columns.UUID(primary_key=True)
        class AllLeveledOptionsModel(Model):
            __options__ = {
                'compaction': {
                    'class': ('org.apache.cassandra.db.compaction.'
                              'LeveledCompactionStrategy'),
                    'sstable_size_in_mb':
                    '64'
                },
            }

            cid = columns.UUID(primary_key=True)
            name = columns.Text()
Esempio n. 10
0
        class AllLeveledOptionsModel(Model):
            __options__ = {
                "compaction": {
                    "class": ("org.apache.cassandra.db.compaction."
                              "LeveledCompactionStrategy"),
                    "sstable_size_in_mb":
                    "64",
                }
            }

            cid = columns.UUID(primary_key=True)
            name = columns.Text()
Esempio n. 11
0
class TestTupleModel(Model):

    partition = columns.UUID(primary_key=True, default=uuid4)
    int_tuple = columns.Tuple(columns.Integer,
                              columns.Integer,
                              columns.Integer,
                              required=False)
    text_tuple = columns.Tuple(columns.Text, columns.Text, required=False)
    mixed_tuple = columns.Tuple(columns.Text,
                                columns.Integer,
                                columns.Text,
                                required=False)
Esempio n. 12
0
 class AllDatatypes(UserType):
     a = columns.Ascii()
     b = columns.BigInt()
     c = columns.Blob()
     d = columns.Boolean()
     e = columns.DateTime()
     f = columns.Decimal()
     g = columns.Double()
     h = columns.Float()
     i = columns.Inet()
     j = columns.Integer()
     k = columns.Text()
     l = columns.TimeUUID()
     m = columns.UUID()
     n = columns.VarInt()
Esempio n. 13
0
 class AllDatatypesModel(Model):
     id = columns.Integer(primary_key=True)
     a = columns.Ascii()
     b = columns.BigInt()
     c = columns.Blob()
     d = columns.Boolean()
     e = columns.DateTime()
     f = columns.Decimal()
     g = columns.Double()
     h = columns.Float()
     i = columns.Inet()
     j = columns.Integer()
     k = columns.Text()
     l = columns.TimeUUID()
     m = columns.UUID()
     n = columns.VarInt()
Esempio n. 14
0
        class AllSizeTieredOptionsModel(Model):
            __options__ = {
                'compaction': {
                    'class': (
                        'org.apache.cassandra.db.compaction.'
                        'SizeTieredCompactionStrategy'
                    ),
                    'bucket_low': '.3',
                    'bucket_high': '2',
                    'min_threshold': '2',
                    'max_threshold': '64',
                    'tombstone_compaction_interval': '86400',
                },
            }

            cid = columns.UUID(primary_key=True)
            name = columns.Text()
Esempio n. 15
0
        class AllSizeTieredOptionsModel(Model):
            __options__ = {
                "compaction": {
                    "class": ("org.apache.cassandra.db.compaction."
                              "SizeTieredCompactionStrategy"),
                    "bucket_low":
                    ".3",
                    "bucket_high":
                    "2",
                    "min_threshold":
                    "2",
                    "max_threshold":
                    "64",
                    "tombstone_compaction_interval":
                    "86400",
                }
            }

            cid = columns.UUID(primary_key=True)
            name = columns.Text()
Esempio n. 16
0
class TestIfNotExistsWithCounterModel(Model):

    id = columns.UUID(primary_key=True, default=uuid4)
    likes = columns.Counter()
Esempio n. 17
0
class TestIndexSetModel(Model):
    partition = columns.UUID(primary_key=True)
    int_set = columns.Set(columns.Integer, index=True)
    int_list = columns.List(columns.Integer, index=True)
    text_map = columns.Map(columns.Text, columns.DateTime, index=True)
    mixed_tuple = columns.Tuple(columns.Text, columns.Integer, columns.Text, index=True)
Esempio n. 18
0
class ChangedInconsistent(Model):

    __table_name__ = "inconsistent"
    __table_name_case_sensitive__ = True
    first_key = columns.UUID(primary_key=True)
    second_key = columns.Text(index=True)
Esempio n. 19
0
class BaseInconsistent(Model):

    __table_name__ = "inconsistent"
    first_key = columns.UUID(primary_key=True)
    second_key = columns.Integer(index=True)
    third_key = columns.Integer(index=True)
Esempio n. 20
0
class IndexCaseSensitiveModel(Model):

    __table_name__ = "IndexModel"
    __table_name_case_sensitive__ = True
    first_key = columns.UUID(primary_key=True)
    second_key = columns.Text(index=True)
Esempio n. 21
0
class IndexModel(Model):

    __table_name__ = "index_model"
    first_key = columns.UUID(primary_key=True)
    second_key = columns.Text(index=True)
    class RenamedTest(Model):
        __table_name__ = 'manual_name'

        id = columns.UUID(primary_key=True)
        data = columns.Text()
        class DelModel(Model):

            id = columns.UUID(primary_key=True, default=uuid4)
            key = columns.Integer(primary_key=True)
            data = columns.Integer(required=False)
        class Model1(Model):

            id = columns.UUID(primary_key=True, default=uuid4)
Esempio n. 25
0
class TestTTLModel(Model):
    id = columns.UUID(primary_key=True, default=uuid4)
    count = columns.Integer()
    text = columns.Text(required=False)
    class RenamedCaseSensitiveTest(Model):
        __table_name__ = 'Manual_Name'
        __table_name_case_sensitive__ = True

        id = columns.UUID(primary_key=True)
        class TestModel(Model):

            id = columns.UUID(primary_key=True, default=uuid4)
            text = columns.Text()
 class NoKeyspace(Model):
     __abstract__ = True
     key = columns.UUID(primary_key=True)
Esempio n. 29
0
class TestDefaultTTLModel(Model):
    __options__ = {"default_time_to_live": 20}
    id = columns.UUID(primary_key=True, default=uuid4)
    count = columns.Integer()
    text = columns.Text(required=False)
        class WildDBNames(Model):

            id = columns.UUID(primary_key=True, default=uuid4)
            content = columns.Text(db_field='words_and_whatnot')
            numbers = columns.Integer(db_field='integers_etc')