Skip to content

Enums Not Enforced Server-Side #686

Open
@waltaskew

Description

@waltaskew

Currently, creating an Enum type with the dialect ala:

sa.Column(
    "an_enum",
    sa.Enum("A", "B", "C"),
),

creates a string column with no server-side checks on enum values. This appears to be because the supports_native_enum field on the dialect is currently set to True, which indicates to SQLAlchemy that it doesn't need to generate the CHECK constraints to actually enforce the enum values server-side. I think this should be set to False so we generate those CHECK constraints.

Spanner's ENUM looks to depend on protos which seems harder to implement. I think just generating those CHECK constraints would be a helpful improvement!

Metadata

Metadata

Assignees

Labels

api: spannerIssues related to the googleapis/python-spanner-sqlalchemy API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions