1// Code generated by protoc-gen-go. DO NOT EDIT. 2// source: google/spanner/v1/transaction.proto 3 4package spanner 5 6import ( 7 fmt "fmt" 8 math "math" 9 10 proto "github.com/golang/protobuf/proto" 11 duration "github.com/golang/protobuf/ptypes/duration" 12 timestamp "github.com/golang/protobuf/ptypes/timestamp" 13 _ "google.golang.org/genproto/googleapis/api/annotations" 14) 15 16// Reference imports to suppress errors if they are not otherwise used. 17var _ = proto.Marshal 18var _ = fmt.Errorf 19var _ = math.Inf 20 21// This is a compile-time assertion to ensure that this generated file 22// is compatible with the proto package it is being compiled against. 23// A compilation error at this line likely means your copy of the 24// proto package needs to be updated. 25const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package 26 27// # Transactions 28// 29// 30// Each session can have at most one active transaction at a time. After the 31// active transaction is completed, the session can immediately be 32// re-used for the next transaction. It is not necessary to create a 33// new session for each transaction. 34// 35// # Transaction Modes 36// 37// Cloud Spanner supports three transaction modes: 38// 39// 1. Locking read-write. This type of transaction is the only way 40// to write data into Cloud Spanner. These transactions rely on 41// pessimistic locking and, if necessary, two-phase commit. 42// Locking read-write transactions may abort, requiring the 43// application to retry. 44// 45// 2. Snapshot read-only. This transaction type provides guaranteed 46// consistency across several reads, but does not allow 47// writes. Snapshot read-only transactions can be configured to 48// read at timestamps in the past. Snapshot read-only 49// transactions do not need to be committed. 50// 51// 3. Partitioned DML. This type of transaction is used to execute 52// a single Partitioned DML statement. Partitioned DML partitions 53// the key space and runs the DML statement over each partition 54// in parallel using separate, internal transactions that commit 55// independently. Partitioned DML transactions do not need to be 56// committed. 57// 58// For transactions that only read, snapshot read-only transactions 59// provide simpler semantics and are almost always faster. In 60// particular, read-only transactions do not take locks, so they do 61// not conflict with read-write transactions. As a consequence of not 62// taking locks, they also do not abort, so retry loops are not needed. 63// 64// Transactions may only read/write data in a single database. They 65// may, however, read/write data in different tables within that 66// database. 67// 68// ## Locking Read-Write Transactions 69// 70// Locking transactions may be used to atomically read-modify-write 71// data anywhere in a database. This type of transaction is externally 72// consistent. 73// 74// Clients should attempt to minimize the amount of time a transaction 75// is active. Faster transactions commit with higher probability 76// and cause less contention. Cloud Spanner attempts to keep read locks 77// active as long as the transaction continues to do reads, and the 78// transaction has not been terminated by 79// [Commit][google.spanner.v1.Spanner.Commit] or 80// [Rollback][google.spanner.v1.Spanner.Rollback]. Long periods of 81// inactivity at the client may cause Cloud Spanner to release a 82// transaction's locks and abort it. 83// 84// Conceptually, a read-write transaction consists of zero or more 85// reads or SQL statements followed by 86// [Commit][google.spanner.v1.Spanner.Commit]. At any time before 87// [Commit][google.spanner.v1.Spanner.Commit], the client can send a 88// [Rollback][google.spanner.v1.Spanner.Rollback] request to abort the 89// transaction. 90// 91// ### Semantics 92// 93// Cloud Spanner can commit the transaction if all read locks it acquired 94// are still valid at commit time, and it is able to acquire write 95// locks for all writes. Cloud Spanner can abort the transaction for any 96// reason. If a commit attempt returns `ABORTED`, Cloud Spanner guarantees 97// that the transaction has not modified any user data in Cloud Spanner. 98// 99// Unless the transaction commits, Cloud Spanner makes no guarantees about 100// how long the transaction's locks were held for. It is an error to 101// use Cloud Spanner locks for any sort of mutual exclusion other than 102// between Cloud Spanner transactions themselves. 103// 104// ### Retrying Aborted Transactions 105// 106// When a transaction aborts, the application can choose to retry the 107// whole transaction again. To maximize the chances of successfully 108// committing the retry, the client should execute the retry in the 109// same session as the original attempt. The original session's lock 110// priority increases with each consecutive abort, meaning that each 111// attempt has a slightly better chance of success than the previous. 112// 113// Under some circumstances (e.g., many transactions attempting to 114// modify the same row(s)), a transaction can abort many times in a 115// short period before successfully committing. Thus, it is not a good 116// idea to cap the number of retries a transaction can attempt; 117// instead, it is better to limit the total amount of wall time spent 118// retrying. 119// 120// ### Idle Transactions 121// 122// A transaction is considered idle if it has no outstanding reads or 123// SQL queries and has not started a read or SQL query within the last 10 124// seconds. Idle transactions can be aborted by Cloud Spanner so that they 125// don't hold on to locks indefinitely. In that case, the commit will 126// fail with error `ABORTED`. 127// 128// If this behavior is undesirable, periodically executing a simple 129// SQL query in the transaction (e.g., `SELECT 1`) prevents the 130// transaction from becoming idle. 131// 132// ## Snapshot Read-Only Transactions 133// 134// Snapshot read-only transactions provides a simpler method than 135// locking read-write transactions for doing several consistent 136// reads. However, this type of transaction does not support writes. 137// 138// Snapshot transactions do not take locks. Instead, they work by 139// choosing a Cloud Spanner timestamp, then executing all reads at that 140// timestamp. Since they do not acquire locks, they do not block 141// concurrent read-write transactions. 142// 143// Unlike locking read-write transactions, snapshot read-only 144// transactions never abort. They can fail if the chosen read 145// timestamp is garbage collected; however, the default garbage 146// collection policy is generous enough that most applications do not 147// need to worry about this in practice. 148// 149// Snapshot read-only transactions do not need to call 150// [Commit][google.spanner.v1.Spanner.Commit] or 151// [Rollback][google.spanner.v1.Spanner.Rollback] (and in fact are not 152// permitted to do so). 153// 154// To execute a snapshot transaction, the client specifies a timestamp 155// bound, which tells Cloud Spanner how to choose a read timestamp. 156// 157// The types of timestamp bound are: 158// 159// - Strong (the default). 160// - Bounded staleness. 161// - Exact staleness. 162// 163// If the Cloud Spanner database to be read is geographically distributed, 164// stale read-only transactions can execute more quickly than strong 165// or read-write transaction, because they are able to execute far 166// from the leader replica. 167// 168// Each type of timestamp bound is discussed in detail below. 169// 170// ### Strong 171// 172// Strong reads are guaranteed to see the effects of all transactions 173// that have committed before the start of the read. Furthermore, all 174// rows yielded by a single read are consistent with each other -- if 175// any part of the read observes a transaction, all parts of the read 176// see the transaction. 177// 178// Strong reads are not repeatable: two consecutive strong read-only 179// transactions might return inconsistent results if there are 180// concurrent writes. If consistency across reads is required, the 181// reads should be executed within a transaction or at an exact read 182// timestamp. 183// 184// See 185// [TransactionOptions.ReadOnly.strong][google.spanner.v1.TransactionOptions.ReadOnly.strong]. 186// 187// ### Exact Staleness 188// 189// These timestamp bounds execute reads at a user-specified 190// timestamp. Reads at a timestamp are guaranteed to see a consistent 191// prefix of the global transaction history: they observe 192// modifications done by all transactions with a commit timestamp <= 193// the read timestamp, and observe none of the modifications done by 194// transactions with a larger commit timestamp. They will block until 195// all conflicting transactions that may be assigned commit timestamps 196// <= the read timestamp have finished. 197// 198// The timestamp can either be expressed as an absolute Cloud Spanner commit 199// timestamp or a staleness relative to the current time. 200// 201// These modes do not require a "negotiation phase" to pick a 202// timestamp. As a result, they execute slightly faster than the 203// equivalent boundedly stale concurrency modes. On the other hand, 204// boundedly stale reads usually return fresher results. 205// 206// See 207// [TransactionOptions.ReadOnly.read_timestamp][google.spanner.v1.TransactionOptions.ReadOnly.read_timestamp] 208// and 209// [TransactionOptions.ReadOnly.exact_staleness][google.spanner.v1.TransactionOptions.ReadOnly.exact_staleness]. 210// 211// ### Bounded Staleness 212// 213// Bounded staleness modes allow Cloud Spanner to pick the read timestamp, 214// subject to a user-provided staleness bound. Cloud Spanner chooses the 215// newest timestamp within the staleness bound that allows execution 216// of the reads at the closest available replica without blocking. 217// 218// All rows yielded are consistent with each other -- if any part of 219// the read observes a transaction, all parts of the read see the 220// transaction. Boundedly stale reads are not repeatable: two stale 221// reads, even if they use the same staleness bound, can execute at 222// different timestamps and thus return inconsistent results. 223// 224// Boundedly stale reads execute in two phases: the first phase 225// negotiates a timestamp among all replicas needed to serve the 226// read. In the second phase, reads are executed at the negotiated 227// timestamp. 228// 229// As a result of the two phase execution, bounded staleness reads are 230// usually a little slower than comparable exact staleness 231// reads. However, they are typically able to return fresher 232// results, and are more likely to execute at the closest replica. 233// 234// Because the timestamp negotiation requires up-front knowledge of 235// which rows will be read, it can only be used with single-use 236// read-only transactions. 237// 238// See 239// [TransactionOptions.ReadOnly.max_staleness][google.spanner.v1.TransactionOptions.ReadOnly.max_staleness] 240// and 241// [TransactionOptions.ReadOnly.min_read_timestamp][google.spanner.v1.TransactionOptions.ReadOnly.min_read_timestamp]. 242// 243// ### Old Read Timestamps and Garbage Collection 244// 245// Cloud Spanner continuously garbage collects deleted and overwritten data 246// in the background to reclaim storage space. This process is known 247// as "version GC". By default, version GC reclaims versions after they 248// are one hour old. Because of this, Cloud Spanner cannot perform reads 249// at read timestamps more than one hour in the past. This 250// restriction also applies to in-progress reads and/or SQL queries whose 251// timestamp become too old while executing. Reads and SQL queries with 252// too-old read timestamps fail with the error `FAILED_PRECONDITION`. 253// 254// ## Partitioned DML Transactions 255// 256// Partitioned DML transactions are used to execute DML statements with a 257// different execution strategy that provides different, and often better, 258// scalability properties for large, table-wide operations than DML in a 259// ReadWrite transaction. Smaller scoped statements, such as an OLTP workload, 260// should prefer using ReadWrite transactions. 261// 262// Partitioned DML partitions the keyspace and runs the DML statement on each 263// partition in separate, internal transactions. These transactions commit 264// automatically when complete, and run independently from one another. 265// 266// To reduce lock contention, this execution strategy only acquires read locks 267// on rows that match the WHERE clause of the statement. Additionally, the 268// smaller per-partition transactions hold locks for less time. 269// 270// That said, Partitioned DML is not a drop-in replacement for standard DML used 271// in ReadWrite transactions. 272// 273// - The DML statement must be fully-partitionable. Specifically, the statement 274// must be expressible as the union of many statements which each access only 275// a single row of the table. 276// 277// - The statement is not applied atomically to all rows of the table. Rather, 278// the statement is applied atomically to partitions of the table, in 279// independent transactions. Secondary index rows are updated atomically 280// with the base table rows. 281// 282// - Partitioned DML does not guarantee exactly-once execution semantics 283// against a partition. The statement will be applied at least once to each 284// partition. It is strongly recommended that the DML statement should be 285// idempotent to avoid unexpected results. For instance, it is potentially 286// dangerous to run a statement such as 287// `UPDATE table SET column = column + 1` as it could be run multiple times 288// against some rows. 289// 290// - The partitions are committed automatically - there is no support for 291// Commit or Rollback. If the call returns an error, or if the client issuing 292// the ExecuteSql call dies, it is possible that some rows had the statement 293// executed on them successfully. It is also possible that statement was 294// never executed against other rows. 295// 296// - Partitioned DML transactions may only contain the execution of a single 297// DML statement via ExecuteSql or ExecuteStreamingSql. 298// 299// - If any error is encountered during the execution of the partitioned DML 300// operation (for instance, a UNIQUE INDEX violation, division by zero, or a 301// value that cannot be stored due to schema constraints), then the 302// operation is stopped at that point and an error is returned. It is 303// possible that at this point, some partitions have been committed (or even 304// committed multiple times), and other partitions have not been run at all. 305// 306// Given the above, Partitioned DML is good fit for large, database-wide, 307// operations that are idempotent, such as deleting old rows from a very large 308// table. 309type TransactionOptions struct { 310 // Required. The type of transaction. 311 // 312 // Types that are valid to be assigned to Mode: 313 // *TransactionOptions_ReadWrite_ 314 // *TransactionOptions_PartitionedDml_ 315 // *TransactionOptions_ReadOnly_ 316 Mode isTransactionOptions_Mode `protobuf_oneof:"mode"` 317 XXX_NoUnkeyedLiteral struct{} `json:"-"` 318 XXX_unrecognized []byte `json:"-"` 319 XXX_sizecache int32 `json:"-"` 320} 321 322func (m *TransactionOptions) Reset() { *m = TransactionOptions{} } 323func (m *TransactionOptions) String() string { return proto.CompactTextString(m) } 324func (*TransactionOptions) ProtoMessage() {} 325func (*TransactionOptions) Descriptor() ([]byte, []int) { 326 return fileDescriptor_a5743daa0b72b00f, []int{0} 327} 328 329func (m *TransactionOptions) XXX_Unmarshal(b []byte) error { 330 return xxx_messageInfo_TransactionOptions.Unmarshal(m, b) 331} 332func (m *TransactionOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 333 return xxx_messageInfo_TransactionOptions.Marshal(b, m, deterministic) 334} 335func (m *TransactionOptions) XXX_Merge(src proto.Message) { 336 xxx_messageInfo_TransactionOptions.Merge(m, src) 337} 338func (m *TransactionOptions) XXX_Size() int { 339 return xxx_messageInfo_TransactionOptions.Size(m) 340} 341func (m *TransactionOptions) XXX_DiscardUnknown() { 342 xxx_messageInfo_TransactionOptions.DiscardUnknown(m) 343} 344 345var xxx_messageInfo_TransactionOptions proto.InternalMessageInfo 346 347type isTransactionOptions_Mode interface { 348 isTransactionOptions_Mode() 349} 350 351type TransactionOptions_ReadWrite_ struct { 352 ReadWrite *TransactionOptions_ReadWrite `protobuf:"bytes,1,opt,name=read_write,json=readWrite,proto3,oneof"` 353} 354 355type TransactionOptions_PartitionedDml_ struct { 356 PartitionedDml *TransactionOptions_PartitionedDml `protobuf:"bytes,3,opt,name=partitioned_dml,json=partitionedDml,proto3,oneof"` 357} 358 359type TransactionOptions_ReadOnly_ struct { 360 ReadOnly *TransactionOptions_ReadOnly `protobuf:"bytes,2,opt,name=read_only,json=readOnly,proto3,oneof"` 361} 362 363func (*TransactionOptions_ReadWrite_) isTransactionOptions_Mode() {} 364 365func (*TransactionOptions_PartitionedDml_) isTransactionOptions_Mode() {} 366 367func (*TransactionOptions_ReadOnly_) isTransactionOptions_Mode() {} 368 369func (m *TransactionOptions) GetMode() isTransactionOptions_Mode { 370 if m != nil { 371 return m.Mode 372 } 373 return nil 374} 375 376func (m *TransactionOptions) GetReadWrite() *TransactionOptions_ReadWrite { 377 if x, ok := m.GetMode().(*TransactionOptions_ReadWrite_); ok { 378 return x.ReadWrite 379 } 380 return nil 381} 382 383func (m *TransactionOptions) GetPartitionedDml() *TransactionOptions_PartitionedDml { 384 if x, ok := m.GetMode().(*TransactionOptions_PartitionedDml_); ok { 385 return x.PartitionedDml 386 } 387 return nil 388} 389 390func (m *TransactionOptions) GetReadOnly() *TransactionOptions_ReadOnly { 391 if x, ok := m.GetMode().(*TransactionOptions_ReadOnly_); ok { 392 return x.ReadOnly 393 } 394 return nil 395} 396 397// XXX_OneofWrappers is for the internal use of the proto package. 398func (*TransactionOptions) XXX_OneofWrappers() []interface{} { 399 return []interface{}{ 400 (*TransactionOptions_ReadWrite_)(nil), 401 (*TransactionOptions_PartitionedDml_)(nil), 402 (*TransactionOptions_ReadOnly_)(nil), 403 } 404} 405 406// Message type to initiate a read-write transaction. Currently this 407// transaction type has no options. 408type TransactionOptions_ReadWrite struct { 409 XXX_NoUnkeyedLiteral struct{} `json:"-"` 410 XXX_unrecognized []byte `json:"-"` 411 XXX_sizecache int32 `json:"-"` 412} 413 414func (m *TransactionOptions_ReadWrite) Reset() { *m = TransactionOptions_ReadWrite{} } 415func (m *TransactionOptions_ReadWrite) String() string { return proto.CompactTextString(m) } 416func (*TransactionOptions_ReadWrite) ProtoMessage() {} 417func (*TransactionOptions_ReadWrite) Descriptor() ([]byte, []int) { 418 return fileDescriptor_a5743daa0b72b00f, []int{0, 0} 419} 420 421func (m *TransactionOptions_ReadWrite) XXX_Unmarshal(b []byte) error { 422 return xxx_messageInfo_TransactionOptions_ReadWrite.Unmarshal(m, b) 423} 424func (m *TransactionOptions_ReadWrite) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 425 return xxx_messageInfo_TransactionOptions_ReadWrite.Marshal(b, m, deterministic) 426} 427func (m *TransactionOptions_ReadWrite) XXX_Merge(src proto.Message) { 428 xxx_messageInfo_TransactionOptions_ReadWrite.Merge(m, src) 429} 430func (m *TransactionOptions_ReadWrite) XXX_Size() int { 431 return xxx_messageInfo_TransactionOptions_ReadWrite.Size(m) 432} 433func (m *TransactionOptions_ReadWrite) XXX_DiscardUnknown() { 434 xxx_messageInfo_TransactionOptions_ReadWrite.DiscardUnknown(m) 435} 436 437var xxx_messageInfo_TransactionOptions_ReadWrite proto.InternalMessageInfo 438 439// Message type to initiate a Partitioned DML transaction. 440type TransactionOptions_PartitionedDml struct { 441 XXX_NoUnkeyedLiteral struct{} `json:"-"` 442 XXX_unrecognized []byte `json:"-"` 443 XXX_sizecache int32 `json:"-"` 444} 445 446func (m *TransactionOptions_PartitionedDml) Reset() { *m = TransactionOptions_PartitionedDml{} } 447func (m *TransactionOptions_PartitionedDml) String() string { return proto.CompactTextString(m) } 448func (*TransactionOptions_PartitionedDml) ProtoMessage() {} 449func (*TransactionOptions_PartitionedDml) Descriptor() ([]byte, []int) { 450 return fileDescriptor_a5743daa0b72b00f, []int{0, 1} 451} 452 453func (m *TransactionOptions_PartitionedDml) XXX_Unmarshal(b []byte) error { 454 return xxx_messageInfo_TransactionOptions_PartitionedDml.Unmarshal(m, b) 455} 456func (m *TransactionOptions_PartitionedDml) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 457 return xxx_messageInfo_TransactionOptions_PartitionedDml.Marshal(b, m, deterministic) 458} 459func (m *TransactionOptions_PartitionedDml) XXX_Merge(src proto.Message) { 460 xxx_messageInfo_TransactionOptions_PartitionedDml.Merge(m, src) 461} 462func (m *TransactionOptions_PartitionedDml) XXX_Size() int { 463 return xxx_messageInfo_TransactionOptions_PartitionedDml.Size(m) 464} 465func (m *TransactionOptions_PartitionedDml) XXX_DiscardUnknown() { 466 xxx_messageInfo_TransactionOptions_PartitionedDml.DiscardUnknown(m) 467} 468 469var xxx_messageInfo_TransactionOptions_PartitionedDml proto.InternalMessageInfo 470 471// Message type to initiate a read-only transaction. 472type TransactionOptions_ReadOnly struct { 473 // How to choose the timestamp for the read-only transaction. 474 // 475 // Types that are valid to be assigned to TimestampBound: 476 // *TransactionOptions_ReadOnly_Strong 477 // *TransactionOptions_ReadOnly_MinReadTimestamp 478 // *TransactionOptions_ReadOnly_MaxStaleness 479 // *TransactionOptions_ReadOnly_ReadTimestamp 480 // *TransactionOptions_ReadOnly_ExactStaleness 481 TimestampBound isTransactionOptions_ReadOnly_TimestampBound `protobuf_oneof:"timestamp_bound"` 482 // If true, the Cloud Spanner-selected read timestamp is included in 483 // the [Transaction][google.spanner.v1.Transaction] message that describes 484 // the transaction. 485 ReturnReadTimestamp bool `protobuf:"varint,6,opt,name=return_read_timestamp,json=returnReadTimestamp,proto3" json:"return_read_timestamp,omitempty"` 486 XXX_NoUnkeyedLiteral struct{} `json:"-"` 487 XXX_unrecognized []byte `json:"-"` 488 XXX_sizecache int32 `json:"-"` 489} 490 491func (m *TransactionOptions_ReadOnly) Reset() { *m = TransactionOptions_ReadOnly{} } 492func (m *TransactionOptions_ReadOnly) String() string { return proto.CompactTextString(m) } 493func (*TransactionOptions_ReadOnly) ProtoMessage() {} 494func (*TransactionOptions_ReadOnly) Descriptor() ([]byte, []int) { 495 return fileDescriptor_a5743daa0b72b00f, []int{0, 2} 496} 497 498func (m *TransactionOptions_ReadOnly) XXX_Unmarshal(b []byte) error { 499 return xxx_messageInfo_TransactionOptions_ReadOnly.Unmarshal(m, b) 500} 501func (m *TransactionOptions_ReadOnly) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 502 return xxx_messageInfo_TransactionOptions_ReadOnly.Marshal(b, m, deterministic) 503} 504func (m *TransactionOptions_ReadOnly) XXX_Merge(src proto.Message) { 505 xxx_messageInfo_TransactionOptions_ReadOnly.Merge(m, src) 506} 507func (m *TransactionOptions_ReadOnly) XXX_Size() int { 508 return xxx_messageInfo_TransactionOptions_ReadOnly.Size(m) 509} 510func (m *TransactionOptions_ReadOnly) XXX_DiscardUnknown() { 511 xxx_messageInfo_TransactionOptions_ReadOnly.DiscardUnknown(m) 512} 513 514var xxx_messageInfo_TransactionOptions_ReadOnly proto.InternalMessageInfo 515 516type isTransactionOptions_ReadOnly_TimestampBound interface { 517 isTransactionOptions_ReadOnly_TimestampBound() 518} 519 520type TransactionOptions_ReadOnly_Strong struct { 521 Strong bool `protobuf:"varint,1,opt,name=strong,proto3,oneof"` 522} 523 524type TransactionOptions_ReadOnly_MinReadTimestamp struct { 525 MinReadTimestamp *timestamp.Timestamp `protobuf:"bytes,2,opt,name=min_read_timestamp,json=minReadTimestamp,proto3,oneof"` 526} 527 528type TransactionOptions_ReadOnly_MaxStaleness struct { 529 MaxStaleness *duration.Duration `protobuf:"bytes,3,opt,name=max_staleness,json=maxStaleness,proto3,oneof"` 530} 531 532type TransactionOptions_ReadOnly_ReadTimestamp struct { 533 ReadTimestamp *timestamp.Timestamp `protobuf:"bytes,4,opt,name=read_timestamp,json=readTimestamp,proto3,oneof"` 534} 535 536type TransactionOptions_ReadOnly_ExactStaleness struct { 537 ExactStaleness *duration.Duration `protobuf:"bytes,5,opt,name=exact_staleness,json=exactStaleness,proto3,oneof"` 538} 539 540func (*TransactionOptions_ReadOnly_Strong) isTransactionOptions_ReadOnly_TimestampBound() {} 541 542func (*TransactionOptions_ReadOnly_MinReadTimestamp) isTransactionOptions_ReadOnly_TimestampBound() {} 543 544func (*TransactionOptions_ReadOnly_MaxStaleness) isTransactionOptions_ReadOnly_TimestampBound() {} 545 546func (*TransactionOptions_ReadOnly_ReadTimestamp) isTransactionOptions_ReadOnly_TimestampBound() {} 547 548func (*TransactionOptions_ReadOnly_ExactStaleness) isTransactionOptions_ReadOnly_TimestampBound() {} 549 550func (m *TransactionOptions_ReadOnly) GetTimestampBound() isTransactionOptions_ReadOnly_TimestampBound { 551 if m != nil { 552 return m.TimestampBound 553 } 554 return nil 555} 556 557func (m *TransactionOptions_ReadOnly) GetStrong() bool { 558 if x, ok := m.GetTimestampBound().(*TransactionOptions_ReadOnly_Strong); ok { 559 return x.Strong 560 } 561 return false 562} 563 564func (m *TransactionOptions_ReadOnly) GetMinReadTimestamp() *timestamp.Timestamp { 565 if x, ok := m.GetTimestampBound().(*TransactionOptions_ReadOnly_MinReadTimestamp); ok { 566 return x.MinReadTimestamp 567 } 568 return nil 569} 570 571func (m *TransactionOptions_ReadOnly) GetMaxStaleness() *duration.Duration { 572 if x, ok := m.GetTimestampBound().(*TransactionOptions_ReadOnly_MaxStaleness); ok { 573 return x.MaxStaleness 574 } 575 return nil 576} 577 578func (m *TransactionOptions_ReadOnly) GetReadTimestamp() *timestamp.Timestamp { 579 if x, ok := m.GetTimestampBound().(*TransactionOptions_ReadOnly_ReadTimestamp); ok { 580 return x.ReadTimestamp 581 } 582 return nil 583} 584 585func (m *TransactionOptions_ReadOnly) GetExactStaleness() *duration.Duration { 586 if x, ok := m.GetTimestampBound().(*TransactionOptions_ReadOnly_ExactStaleness); ok { 587 return x.ExactStaleness 588 } 589 return nil 590} 591 592func (m *TransactionOptions_ReadOnly) GetReturnReadTimestamp() bool { 593 if m != nil { 594 return m.ReturnReadTimestamp 595 } 596 return false 597} 598 599// XXX_OneofWrappers is for the internal use of the proto package. 600func (*TransactionOptions_ReadOnly) XXX_OneofWrappers() []interface{} { 601 return []interface{}{ 602 (*TransactionOptions_ReadOnly_Strong)(nil), 603 (*TransactionOptions_ReadOnly_MinReadTimestamp)(nil), 604 (*TransactionOptions_ReadOnly_MaxStaleness)(nil), 605 (*TransactionOptions_ReadOnly_ReadTimestamp)(nil), 606 (*TransactionOptions_ReadOnly_ExactStaleness)(nil), 607 } 608} 609 610// A transaction. 611type Transaction struct { 612 // `id` may be used to identify the transaction in subsequent 613 // [Read][google.spanner.v1.Spanner.Read], 614 // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], 615 // [Commit][google.spanner.v1.Spanner.Commit], or 616 // [Rollback][google.spanner.v1.Spanner.Rollback] calls. 617 // 618 // Single-use read-only transactions do not have IDs, because 619 // single-use transactions do not support multiple requests. 620 Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` 621 // For snapshot read-only transactions, the read timestamp chosen 622 // for the transaction. Not returned by default: see 623 // [TransactionOptions.ReadOnly.return_read_timestamp][google.spanner.v1.TransactionOptions.ReadOnly.return_read_timestamp]. 624 // 625 // A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. 626 // Example: `"2014-10-02T15:01:23.045123456Z"`. 627 ReadTimestamp *timestamp.Timestamp `protobuf:"bytes,2,opt,name=read_timestamp,json=readTimestamp,proto3" json:"read_timestamp,omitempty"` 628 XXX_NoUnkeyedLiteral struct{} `json:"-"` 629 XXX_unrecognized []byte `json:"-"` 630 XXX_sizecache int32 `json:"-"` 631} 632 633func (m *Transaction) Reset() { *m = Transaction{} } 634func (m *Transaction) String() string { return proto.CompactTextString(m) } 635func (*Transaction) ProtoMessage() {} 636func (*Transaction) Descriptor() ([]byte, []int) { 637 return fileDescriptor_a5743daa0b72b00f, []int{1} 638} 639 640func (m *Transaction) XXX_Unmarshal(b []byte) error { 641 return xxx_messageInfo_Transaction.Unmarshal(m, b) 642} 643func (m *Transaction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 644 return xxx_messageInfo_Transaction.Marshal(b, m, deterministic) 645} 646func (m *Transaction) XXX_Merge(src proto.Message) { 647 xxx_messageInfo_Transaction.Merge(m, src) 648} 649func (m *Transaction) XXX_Size() int { 650 return xxx_messageInfo_Transaction.Size(m) 651} 652func (m *Transaction) XXX_DiscardUnknown() { 653 xxx_messageInfo_Transaction.DiscardUnknown(m) 654} 655 656var xxx_messageInfo_Transaction proto.InternalMessageInfo 657 658func (m *Transaction) GetId() []byte { 659 if m != nil { 660 return m.Id 661 } 662 return nil 663} 664 665func (m *Transaction) GetReadTimestamp() *timestamp.Timestamp { 666 if m != nil { 667 return m.ReadTimestamp 668 } 669 return nil 670} 671 672// This message is used to select the transaction in which a 673// [Read][google.spanner.v1.Spanner.Read] or 674// [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] call runs. 675// 676// See [TransactionOptions][google.spanner.v1.TransactionOptions] for more 677// information about transactions. 678type TransactionSelector struct { 679 // If no fields are set, the default is a single use transaction 680 // with strong concurrency. 681 // 682 // Types that are valid to be assigned to Selector: 683 // *TransactionSelector_SingleUse 684 // *TransactionSelector_Id 685 // *TransactionSelector_Begin 686 Selector isTransactionSelector_Selector `protobuf_oneof:"selector"` 687 XXX_NoUnkeyedLiteral struct{} `json:"-"` 688 XXX_unrecognized []byte `json:"-"` 689 XXX_sizecache int32 `json:"-"` 690} 691 692func (m *TransactionSelector) Reset() { *m = TransactionSelector{} } 693func (m *TransactionSelector) String() string { return proto.CompactTextString(m) } 694func (*TransactionSelector) ProtoMessage() {} 695func (*TransactionSelector) Descriptor() ([]byte, []int) { 696 return fileDescriptor_a5743daa0b72b00f, []int{2} 697} 698 699func (m *TransactionSelector) XXX_Unmarshal(b []byte) error { 700 return xxx_messageInfo_TransactionSelector.Unmarshal(m, b) 701} 702func (m *TransactionSelector) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 703 return xxx_messageInfo_TransactionSelector.Marshal(b, m, deterministic) 704} 705func (m *TransactionSelector) XXX_Merge(src proto.Message) { 706 xxx_messageInfo_TransactionSelector.Merge(m, src) 707} 708func (m *TransactionSelector) XXX_Size() int { 709 return xxx_messageInfo_TransactionSelector.Size(m) 710} 711func (m *TransactionSelector) XXX_DiscardUnknown() { 712 xxx_messageInfo_TransactionSelector.DiscardUnknown(m) 713} 714 715var xxx_messageInfo_TransactionSelector proto.InternalMessageInfo 716 717type isTransactionSelector_Selector interface { 718 isTransactionSelector_Selector() 719} 720 721type TransactionSelector_SingleUse struct { 722 SingleUse *TransactionOptions `protobuf:"bytes,1,opt,name=single_use,json=singleUse,proto3,oneof"` 723} 724 725type TransactionSelector_Id struct { 726 Id []byte `protobuf:"bytes,2,opt,name=id,proto3,oneof"` 727} 728 729type TransactionSelector_Begin struct { 730 Begin *TransactionOptions `protobuf:"bytes,3,opt,name=begin,proto3,oneof"` 731} 732 733func (*TransactionSelector_SingleUse) isTransactionSelector_Selector() {} 734 735func (*TransactionSelector_Id) isTransactionSelector_Selector() {} 736 737func (*TransactionSelector_Begin) isTransactionSelector_Selector() {} 738 739func (m *TransactionSelector) GetSelector() isTransactionSelector_Selector { 740 if m != nil { 741 return m.Selector 742 } 743 return nil 744} 745 746func (m *TransactionSelector) GetSingleUse() *TransactionOptions { 747 if x, ok := m.GetSelector().(*TransactionSelector_SingleUse); ok { 748 return x.SingleUse 749 } 750 return nil 751} 752 753func (m *TransactionSelector) GetId() []byte { 754 if x, ok := m.GetSelector().(*TransactionSelector_Id); ok { 755 return x.Id 756 } 757 return nil 758} 759 760func (m *TransactionSelector) GetBegin() *TransactionOptions { 761 if x, ok := m.GetSelector().(*TransactionSelector_Begin); ok { 762 return x.Begin 763 } 764 return nil 765} 766 767// XXX_OneofWrappers is for the internal use of the proto package. 768func (*TransactionSelector) XXX_OneofWrappers() []interface{} { 769 return []interface{}{ 770 (*TransactionSelector_SingleUse)(nil), 771 (*TransactionSelector_Id)(nil), 772 (*TransactionSelector_Begin)(nil), 773 } 774} 775 776func init() { 777 proto.RegisterType((*TransactionOptions)(nil), "google.spanner.v1.TransactionOptions") 778 proto.RegisterType((*TransactionOptions_ReadWrite)(nil), "google.spanner.v1.TransactionOptions.ReadWrite") 779 proto.RegisterType((*TransactionOptions_PartitionedDml)(nil), "google.spanner.v1.TransactionOptions.PartitionedDml") 780 proto.RegisterType((*TransactionOptions_ReadOnly)(nil), "google.spanner.v1.TransactionOptions.ReadOnly") 781 proto.RegisterType((*Transaction)(nil), "google.spanner.v1.Transaction") 782 proto.RegisterType((*TransactionSelector)(nil), "google.spanner.v1.TransactionSelector") 783} 784 785func init() { 786 proto.RegisterFile("google/spanner/v1/transaction.proto", fileDescriptor_a5743daa0b72b00f) 787} 788 789var fileDescriptor_a5743daa0b72b00f = []byte{ 790 // 573 bytes of a gzipped FileDescriptorProto 791 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0xdf, 0x6e, 0xd3, 0x3e, 792 0x14, 0xc7, 0xd3, 0x6e, 0xab, 0xba, 0xd3, 0xae, 0xed, 0x3c, 0x4d, 0xbf, 0xfe, 0x22, 0x04, 0xa8, 793 0x08, 0x89, 0xab, 0x44, 0x1d, 0x5c, 0x20, 0x21, 0x24, 0xe8, 0x2a, 0x88, 0x90, 0xd0, 0xaa, 0x74, 794 0x0c, 0x09, 0x55, 0x0a, 0x6e, 0x63, 0x22, 0x4b, 0x89, 0x1d, 0xd9, 0xce, 0xe8, 0xee, 0x79, 0x09, 795 0x5e, 0x81, 0x47, 0xe0, 0x9a, 0x2b, 0x9e, 0x0a, 0xc5, 0x71, 0xfa, 0x2f, 0x17, 0xeb, 0x5d, 0xec, 796 0x73, 0xbe, 0xdf, 0xf3, 0xf1, 0x39, 0x76, 0xe0, 0x49, 0xc4, 0x79, 0x14, 0x13, 0x57, 0xa6, 0x98, 797 0x31, 0x22, 0xdc, 0xdb, 0xa1, 0xab, 0x04, 0x66, 0x12, 0x2f, 0x14, 0xe5, 0xcc, 0x49, 0x05, 0x57, 798 0x1c, 0x9d, 0x16, 0x49, 0x8e, 0x49, 0x72, 0x6e, 0x87, 0xf6, 0x03, 0xa3, 0xc3, 0x29, 0x75, 0x31, 799 0x63, 0x5c, 0xe1, 0x3c, 0x5f, 0x16, 0x02, 0xfb, 0xa1, 0x89, 0xea, 0xd5, 0x3c, 0xfb, 0xe6, 0x86, 800 0x99, 0xc0, 0x6b, 0x43, 0xfb, 0xd1, 0x6e, 0x5c, 0xd1, 0x84, 0x48, 0x85, 0x93, 0xb4, 0x48, 0x18, 801 0xfc, 0x39, 0x02, 0x74, 0xbd, 0xe6, 0xb8, 0x4a, 0xb5, 0x3b, 0x9a, 0x00, 0x08, 0x82, 0xc3, 0xe0, 802 0xbb, 0xa0, 0x8a, 0xf4, 0x6b, 0x8f, 0x6b, 0xcf, 0x5a, 0x17, 0xae, 0x53, 0xa1, 0x73, 0xaa, 0x52, 803 0xc7, 0x27, 0x38, 0xfc, 0x9c, 0xcb, 0x3c, 0xcb, 0x3f, 0x16, 0xe5, 0x02, 0x05, 0xd0, 0x4d, 0xb1, 804 0x50, 0x34, 0x4f, 0x22, 0x61, 0x10, 0x26, 0x71, 0xff, 0x40, 0xdb, 0xbe, 0xd8, 0xcf, 0x76, 0xb2, 805 0x16, 0x8f, 0x93, 0xd8, 0xb3, 0xfc, 0x4e, 0xba, 0xb5, 0x83, 0x3e, 0x82, 0xae, 0x16, 0x70, 0x16, 806 0xdf, 0xf5, 0xeb, 0xda, 0xda, 0xd9, 0x9f, 0xf8, 0x8a, 0xc5, 0x77, 0x9e, 0xe5, 0x37, 0x85, 0xf9, 807 0xb6, 0x5b, 0x70, 0xbc, 0x3a, 0x89, 0xdd, 0x83, 0xce, 0x76, 0x7d, 0xfb, 0xc7, 0x01, 0x34, 0x4b, 808 0x1d, 0xea, 0x43, 0x43, 0x2a, 0xc1, 0x59, 0xa4, 0x3b, 0xd5, 0xf4, 0x2c, 0xdf, 0xac, 0xd1, 0x07, 809 0x40, 0x09, 0x65, 0x81, 0x06, 0x5b, 0xb5, 0xde, 0xd0, 0xd9, 0x25, 0x5d, 0x39, 0x1c, 0xe7, 0xba, 810 0xcc, 0xf0, 0x2c, 0xbf, 0x97, 0x50, 0x96, 0x17, 0x58, 0xed, 0xa1, 0x37, 0x70, 0x92, 0xe0, 0x65, 811 0x20, 0x15, 0x8e, 0x09, 0x23, 0x52, 0x9a, 0xfe, 0xfd, 0x5f, 0xb1, 0x19, 0x9b, 0x3b, 0xe0, 0x59, 812 0x7e, 0x3b, 0xc1, 0xcb, 0x69, 0x29, 0x40, 0x97, 0xd0, 0xd9, 0x21, 0x39, 0xdc, 0x83, 0xe4, 0x44, 813 0x6c, 0x61, 0x8c, 0xa1, 0x4b, 0x96, 0x78, 0xa1, 0x36, 0x40, 0x8e, 0xee, 0x07, 0xe9, 0x68, 0xcd, 814 0x1a, 0xe5, 0x02, 0xce, 0x05, 0x51, 0x99, 0xa8, 0xf4, 0xa6, 0x91, 0x77, 0xd0, 0x3f, 0x2b, 0x82, 815 0x5b, 0x0d, 0x18, 0x9d, 0x42, 0x77, 0x95, 0x17, 0xcc, 0x79, 0xc6, 0xc2, 0x51, 0x03, 0x0e, 0x13, 816 0x1e, 0x92, 0xc1, 0x57, 0x68, 0x6d, 0x0c, 0x16, 0x75, 0xa0, 0x4e, 0x43, 0x3d, 0x8c, 0xb6, 0x5f, 817 0xa7, 0x21, 0x7a, 0x5b, 0x39, 0xf8, 0xbd, 0x23, 0xd8, 0x39, 0xf6, 0xe0, 0x77, 0x0d, 0xce, 0x36, 818 0x4a, 0x4c, 0x49, 0x4c, 0x16, 0x8a, 0x0b, 0xf4, 0x0e, 0x40, 0x52, 0x16, 0xc5, 0x24, 0xc8, 0x64, 819 0xf9, 0x52, 0x9e, 0xee, 0x75, 0xef, 0xf2, 0xf7, 0x51, 0x48, 0x3f, 0x49, 0x82, 0x7a, 0x1a, 0x39, 820 0xc7, 0x6a, 0x7b, 0x96, 0x86, 0x7e, 0x0d, 0x47, 0x73, 0x12, 0x51, 0x66, 0xe6, 0xbc, 0xb7, 0x69, 821 0xa1, 0x1a, 0x01, 0x34, 0xa5, 0x81, 0x1c, 0xfd, 0xac, 0xc1, 0xf9, 0x82, 0x27, 0x55, 0x87, 0x51, 822 0x6f, 0xc3, 0x62, 0x92, 0x37, 0x61, 0x52, 0xfb, 0xf2, 0xd2, 0xa4, 0x45, 0x3c, 0xc6, 0x2c, 0x72, 823 0xb8, 0x88, 0xdc, 0x88, 0x30, 0xdd, 0x22, 0xb7, 0x08, 0xe1, 0x94, 0xca, 0x8d, 0x3f, 0xd9, 0x2b, 824 0xf3, 0xf9, 0xab, 0xfe, 0xdf, 0xfb, 0x42, 0x7a, 0x19, 0xf3, 0x2c, 0x74, 0xa6, 0xa6, 0xce, 0xcd, 825 0xf0, 0x6f, 0x19, 0x99, 0xe9, 0xc8, 0xcc, 0x44, 0x66, 0x37, 0xc3, 0x79, 0x43, 0x1b, 0x3f, 0xff, 826 0x17, 0x00, 0x00, 0xff, 0xff, 0x81, 0xd7, 0x1c, 0x8e, 0x21, 0x05, 0x00, 0x00, 827} 828