From c6ad1bb1cf6c63f51db2ad62c56e8c1bbfe89651 Mon Sep 17 00:00:00 2001 From: Rached Ben Ayed Date: Tue, 18 Jul 2023 17:57:24 +0200 Subject: [PATCH] feat: rollback spanner Tx --- gcloud/helpers/spanner/tx.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/gcloud/helpers/spanner/tx.go b/gcloud/helpers/spanner/tx.go index eb9f9e2..633829c 100644 --- a/gcloud/helpers/spanner/tx.go +++ b/gcloud/helpers/spanner/tx.go @@ -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) @@ -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) -}