Amit Kaneria
Amit Kaneria

Reputation: 5808

Cassandra constraints

We have a usecase of allowing only certain values in a cassandra column.

Example:

 CREATED TABLE Cars(
    company text,
    model text,
    year int,
    vin text
 )

where a company may be from a spcific list of car makers e.g. GM, Toyota, Honda etc.

Does cassandra support defining constraints for above use-case ? OR this needs to be handled at program level ?

Upvotes: 2

Views: 166

Answers (1)

undefined_variable
undefined_variable

Reputation: 6218

There is no in built support for enums in cassandra.

But Datastax drivers does have option to define custom codec, which might help.

Enum Java Driver

Upvotes: 4

Related Questions