Is your feature request related to a problem? Please describe.
I was trying to setup the following table:
singers = Table(
"Singers",
metadata,
Column("SingerId", String(36), primary_key=True, nullable=False),
Column("FirstName", String(200)),
Column("LastName", String(200), nullable=False),
Column("FullName", String(400), nullable=False, Computed("COALESCE(FirstName || ' ', '') || LastName")
)
and I got this error from the Spanner backend:
google.api_core.exceptions.InvalidArgument: 400 Error parsing Spanner DDL statement: CREATE TABLE `Singers` (\n\t`SingerId` STRING(36) NOT NULL, \n\t`FirstName` STRING(200), \n\t`LastName` STRING(200) NOT NULL, \n\t`FullName` STRING(400) GENERATED ALWAYS AS (COALESCE(FirstName || \' \', \'\') || LastName) NOT NULL\n) PRIMARY KEY (SingerId) : Syntax error on line 5, column 25: Expecting \')\' but found \'GENERATED\'
This happens because SQLAlchemy translates Generated("<computation>") to GENERATED ALWAYS AS (<computation>) STORED. But Spanner syntax for generated colums is AS (<computation>) STORED.
Describe the solution you'd like
Support generated columns as Spanner expects it.
Is your feature request related to a problem? Please describe.
I was trying to setup the following table:
and I got this error from the Spanner backend:
This happens because SQLAlchemy translates
Generated("<computation>")toGENERATED ALWAYS AS (<computation>) STORED. But Spanner syntax for generated colums isAS (<computation>) STORED.Describe the solution you'd like
Support generated columns as Spanner expects it.