New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(spanner/spansql): support DEFAULT keyword #5932
feat(spanner/spansql): support DEFAULT keyword #5932
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). For more information, open the CLA check for this pull request. |
@@ -254,6 +265,9 @@ func (cd ColumnDef) SQL() string { | |||
if cd.NotNull { | |||
str += " NOT NULL" | |||
} | |||
if cd.Default != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(cd ColumnDef) SQL()
generates an invalid SQL like ... DEFAULT (...) AS (...) STORED
when both of Default
and Generated
are not nil. I thought about adding a enum-like const that has Default, Generated or None as a value but I didn't implement that because it will break compatibility.
I noticed my mistakes and fixed them. |
close: #5916
DEFAULT
inCREATE TABLE
andALTER TABLE ... ADD COLUMN
DEFAULT
inALTER TABLE ... ALTER COLUMN
SET DEFAULT
andDROP DEFAULT