Skip to content

Commit

Permalink
feat: rollback spanner Tx
Browse files Browse the repository at this point in the history
  • Loading branch information
Rached Ben Ayed committed Jul 18, 2023
1 parent b3ee963 commit c6ad1bb
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions gcloud/helpers/spanner/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"cloud.google.com/go/spanner/apiv1/spannerpb"
)

// ReadTx is a common interface for spanner read only and read/write transactions that only read
type ReadTx interface {
// Tx is a common interface for spanner read only and read/write transactions that only read
type Tx interface {
Read(ctx context.Context, table string, keys spanner.KeySet, columns []string) *spanner.RowIterator
ReadUsingIndex(ctx context.Context, table, index string, keys spanner.KeySet, columns []string) (ri *spanner.RowIterator)
ReadWithOptions(ctx context.Context, table string, keys spanner.KeySet, columns []string, opts *spanner.ReadOptions) (ri *spanner.RowIterator)
Expand All @@ -17,10 +17,3 @@ type ReadTx interface {
QueryWithStats(ctx context.Context, statement spanner.Statement) *spanner.RowIterator
AnalyzeQuery(ctx context.Context, statement spanner.Statement) (*spannerpb.QueryPlan, error)
}

// ReadWriteTx is a common interface for spanner read/write transactions
type ReadWriteTx interface {
ReadTx
BufferWrite([]*spanner.Mutation) error
Update(ctx context.Context, stmt spanner.Statement) (rowCount int64, err error)
}

0 comments on commit c6ad1bb

Please sign in to comment.