Skip to content

Case

SQLEnumSyntax.unsupported

No enumeration type is supported.
case unsupported

Discussion

For dialects which do not have native enumeration support, a simple string column can serve the same function, with the caveat that its correctness will not be enforced by the database, unless the database supports CHECK constraints and such a constraint is appropriately applied.

SQLite example:

CREATE TABLE "foo" (
    "id" INTEGER PRIMARY KEY,
    "my_fruit" TEXT NOT NULL CHECK
        ("my_fruit" IN ('apple', 'orange', 'banana'))
);