Description
WHAT
Detect that CommitTimestamp contains time.Now () in TIMESTAMP column with allow_commit_timestamp = true
WHY
Unless there are special circumstances, set the commit_timestamp column to
spanner.CommitTimestamp.
If time.Now () is included, Transaction will fail if a future time is set due to the time difference of the execution environment.
It's hard to notice in Test that the time is a few ms in the future, so it would be nice to be able to find it by static analysis.
However, it is difficult to judge whether it is allow_commit_timestamp = true because it is time.Time type in Go source code.
yo will add a new tag to the allow_commit_timestamp column of the generated code.
I can't come up with a good way to determine if a TIMESTAMP column is an allow_commit_timestamp column if I'm still using google-cloud-go 🤔