-
Notifications
You must be signed in to change notification settings - Fork 34
Closed
Labels
api: spannerIssues related to the googleapis/python-spanner-sqlalchemy API.Issues related to the googleapis/python-spanner-sqlalchemy API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-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.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Currently, creating an Enum type with the dialect ala:
sa.Column(
"an_enum",
sa.Enum("A", "B", "C", create_constraint=True),
),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.Issues related to the googleapis/python-spanner-sqlalchemy API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-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.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.