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): add ROW DELETION POLICY parsing #4496
Conversation
This enables to parse `ROW DELETION POLICY` at `CREATE TABLE`, `ALTER TABLE` clauses.
@olavloite It's worth to note that this feature is currently preview. So it is not open to the public yet. |
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.
Looks good to me. I have a question/suggestion on where to start the parsing of the row deletion policy expression, but feel free to leave it as is if you think that is better.
spanner/spansql/parser.go
Outdated
@@ -1236,6 +1245,15 @@ func (p *parser) parseAlterTable() (*AlterTable, *parseError) { | |||
return a, nil | |||
} | |||
|
|||
if p.eat("ROW") { |
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.
Suggestion: Would it maybe make more sense to check if you can eat ROW DELETION POLICY
here, and then only parse the actual expression. The same would then also apply to the REPLACE ROW DELETION POLICY
?
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.
Thanks!
Certainly, this makes easier to switch if another syntax is added after the ROW token.
I fixed at d83fb53
This enables to parse
ROW DELETION POLICY
atCREATE TABLE
,ALTER TABLE
clauses.https://cloud.google.com/spanner/docs/ttl
(This feature is currently preview.)