+
Skip to content

proposal: spanner.CommitTimestamp check #33

Open
@sinmetal

Description

@sinmetal

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 🤔

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载