Skip to content
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

Merged
merged 5 commits into from Apr 27, 2022

Conversation

neglect-yp
Copy link
Contributor

@neglect-yp neglect-yp commented Apr 22, 2022

close: #5916

  • support DEFAULT in CREATE TABLE and ALTER TABLE ... ADD COLUMN
  • support DEFAULT in ALTER TABLE ... ALTER COLUMN
    • type, SET DEFAULT and DROP DEFAULT

@neglect-yp neglect-yp requested review from a team as code owners April 22, 2022 15:13
@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: spanner Issues related to the Spanner API. labels Apr 22, 2022
@google-cla
Copy link

google-cla bot commented Apr 22, 2022

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 {
Copy link
Contributor Author

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.

@rahul2393 rahul2393 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 25, 2022
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 25, 2022
@neglect-yp
Copy link
Contributor Author

I noticed my mistakes and fixed them.

@rahul2393 rahul2393 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 26, 2022
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 26, 2022
@rahul2393 rahul2393 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 27, 2022
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 27, 2022
@rahul2393 rahul2393 merged commit 49c19a9 into googleapis:main Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the Spanner API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

spanner/spansql: support a default value for a column when creating or altering a table
3 participants