googleapis / googleapis/google-cloud-go
bigtable: Get underlying protobuf of mutation ops
- Dominant language
- Go
- Stars
- 4.5k
- Forks
- 1.6k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 109
Description
Ref: https://github.com/googleapis/google-cloud-go/blob/main/bigtable/bigtable.go#L878
We have a handful of systems that make liberal use of BigTable. To make replaying, diagnosing, or dry-running previous events possible, I want to record the database decisions made for a given input.
With traditional databases, I'd record the rendered SQL template(s). I don't exactly have that with BigTable — but internally this library has it. Are the operations unexported explicitly, or just because this use-case hasn't come up?
To get around this, I'm going to embed `*bigtable.Mutation` and do my own recording. But our stuff can be high volume, and I'd love to not need to allocate extra things forever.
```go
type Mutation struct {
*bigtable.Mutation
// Some internal tracking here
}
func (m *Mutation) Set(family, column string, ts bigtable.Timestamp, value []byte) {
m.Mutation.Set(family, column, ts, value)
}
func (m *Mutation) DeleteCellsInColumn(family, column string) {
m.Mutation.DeleteCellsInColumn(family, column)
}
```
It would be helpful if `mutation.Ops()` or similar returned the underlying value instead.
Contributor guide
Assessment
This issue has not been assessed yet.