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 [TransactionOptions.ReadOnly.strong][google.spanner.v1.TransactionOptions.ReadOnly.strong]. 185// 186// ### Exact Staleness 187// 188// These timestamp bounds execute reads at a user-specified 189// timestamp. Reads at a timestamp are guaranteed to see a consistent 190// prefix of the global transaction history: they observe 191// modifications done by all transactions with a commit timestamp <= 192// the read timestamp, and observe none of the modifications done by 193// transactions with a larger commit timestamp. They will block until 194// all conflicting transactions that may be assigned commit timestamps 195// <= the read timestamp have finished. 196// 197// The timestamp can either be expressed as an absolute Cloud Spanner commit 198// timestamp or a staleness relative to the current time. 199// 200// These modes do not require a "negotiation phase" to pick a 201// timestamp. As a result, they execute slightly faster than the 202// equivalent boundedly stale concurrency modes. On the other hand, 203// boundedly stale reads usually return fresher results. 204// 205// See [TransactionOptions.ReadOnly.read_timestamp][google.spanner.v1.TransactionOptions.ReadOnly.read_timestamp] and 206// [TransactionOptions.ReadOnly.exact_staleness][google.spanner.v1.TransactionOptions.ReadOnly.exact_staleness]. 207// 208// ### Bounded Staleness 209// 210// Bounded staleness modes allow Cloud Spanner to pick the read timestamp, 211// subject to a user-provided staleness bound. Cloud Spanner chooses the 212// newest timestamp within the staleness bound that allows execution 213// of the reads at the closest available replica without blocking. 214// 215// All rows yielded are consistent with each other -- if any part of 216// the read observes a transaction, all parts of the read see the 217// transaction. Boundedly stale reads are not repeatable: two stale 218// reads, even if they use the same staleness bound, can execute at 219// different timestamps and thus return inconsistent results. 220// 221// Boundedly stale reads execute in two phases: the first phase 222// negotiates a timestamp among all replicas needed to serve the 223// read. In the second phase, reads are executed at the negotiated 224// timestamp. 225// 226// As a result of the two phase execution, bounded staleness reads are 227// usually a little slower than comparable exact staleness 228// reads. However, they are typically able to return fresher 229// results, and are more likely to execute at the closest replica. 230// 231// Because the timestamp negotiation requires up-front knowledge of 232// which rows will be read, it can only be used with single-use 233// read-only transactions. 234// 235// See [TransactionOptions.ReadOnly.max_staleness][google.spanner.v1.TransactionOptions.ReadOnly.max_staleness] and 236// [TransactionOptions.ReadOnly.min_read_timestamp][google.spanner.v1.TransactionOptions.ReadOnly.min_read_timestamp]. 237// 238// ### Old Read Timestamps and Garbage Collection 239// 240// Cloud Spanner continuously garbage collects deleted and overwritten data 241// in the background to reclaim storage space. This process is known 242// as "version GC". By default, version GC reclaims versions after they 243// are one hour old. Because of this, Cloud Spanner cannot perform reads 244// at read timestamps more than one hour in the past. This 245// restriction also applies to in-progress reads and/or SQL queries whose 246// timestamp become too old while executing. Reads and SQL queries with 247// too-old read timestamps fail with the error `FAILED_PRECONDITION`. 248// 249// ## Partitioned DML Transactions 250// 251// Partitioned DML transactions are used to execute DML statements with a 252// different execution strategy that provides different, and often better, 253// scalability properties for large, table-wide operations than DML in a 254// ReadWrite transaction. Smaller scoped statements, such as an OLTP workload, 255// should prefer using ReadWrite transactions. 256// 257// Partitioned DML partitions the keyspace and runs the DML statement on each 258// partition in separate, internal transactions. These transactions commit 259// automatically when complete, and run independently from one another. 260// 261// To reduce lock contention, this execution strategy only acquires read locks 262// on rows that match the WHERE clause of the statement. Additionally, the 263// smaller per-partition transactions hold locks for less time. 264// 265// That said, Partitioned DML is not a drop-in replacement for standard DML used 266// in ReadWrite transactions. 267// 268// - The DML statement must be fully-partitionable. Specifically, the statement 269// must be expressible as the union of many statements which each access only 270// a single row of the table. 271// 272// - The statement is not applied atomically to all rows of the table. Rather, 273// the statement is applied atomically to partitions of the table, in 274// independent transactions. Secondary index rows are updated atomically 275// with the base table rows. 276// 277// - Partitioned DML does not guarantee exactly-once execution semantics 278// against a partition. The statement will be applied at least once to each 279// partition. It is strongly recommended that the DML statement should be 280// idempotent to avoid unexpected results. For instance, it is potentially 281// dangerous to run a statement such as 282// `UPDATE table SET column = column + 1` as it could be run multiple times 283// against some rows. 284// 285// - The partitions are committed automatically - there is no support for 286// Commit or Rollback. If the call returns an error, or if the client issuing 287// the ExecuteSql call dies, it is possible that some rows had the statement 288// executed on them successfully. It is also possible that statement was 289// never executed against other rows. 290// 291// - Partitioned DML transactions may only contain the execution of a single 292// DML statement via ExecuteSql or ExecuteStreamingSql. 293// 294// - If any error is encountered during the execution of the partitioned DML 295// operation (for instance, a UNIQUE INDEX violation, division by zero, or a 296// value that cannot be stored due to schema constraints), then the 297// operation is stopped at that point and an error is returned. It is 298// possible that at this point, some partitions have been committed (or even 299// committed multiple times), and other partitions have not been run at all. 300// 301// Given the above, Partitioned DML is good fit for large, database-wide, 302// operations that are idempotent, such as deleting old rows from a very large 303// table. 304type TransactionOptions struct { 305 // Required. The type of transaction. 306 // 307 // Types that are valid to be assigned to Mode: 308 // *TransactionOptions_ReadWrite_ 309 // *TransactionOptions_PartitionedDml_ 310 // *TransactionOptions_ReadOnly_ 311 Mode isTransactionOptions_Mode `protobuf_oneof:"mode"` 312 XXX_NoUnkeyedLiteral struct{} `json:"-"` 313 XXX_unrecognized []byte `json:"-"` 314 XXX_sizecache int32 `json:"-"` 315} 316 317func (m *TransactionOptions) Reset() { *m = TransactionOptions{} } 318func (m *TransactionOptions) String() string { return proto.CompactTextString(m) } 319func (*TransactionOptions) ProtoMessage() {} 320func (*TransactionOptions) Descriptor() ([]byte, []int) { 321 return fileDescriptor_a5743daa0b72b00f, []int{0} 322} 323 324func (m *TransactionOptions) XXX_Unmarshal(b []byte) error { 325 return xxx_messageInfo_TransactionOptions.Unmarshal(m, b) 326} 327func (m *TransactionOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 328 return xxx_messageInfo_TransactionOptions.Marshal(b, m, deterministic) 329} 330func (m *TransactionOptions) XXX_Merge(src proto.Message) { 331 xxx_messageInfo_TransactionOptions.Merge(m, src) 332} 333func (m *TransactionOptions) XXX_Size() int { 334 return xxx_messageInfo_TransactionOptions.Size(m) 335} 336func (m *TransactionOptions) XXX_DiscardUnknown() { 337 xxx_messageInfo_TransactionOptions.DiscardUnknown(m) 338} 339 340var xxx_messageInfo_TransactionOptions proto.InternalMessageInfo 341 342type isTransactionOptions_Mode interface { 343 isTransactionOptions_Mode() 344} 345 346type TransactionOptions_ReadWrite_ struct { 347 ReadWrite *TransactionOptions_ReadWrite `protobuf:"bytes,1,opt,name=read_write,json=readWrite,proto3,oneof"` 348} 349 350type TransactionOptions_PartitionedDml_ struct { 351 PartitionedDml *TransactionOptions_PartitionedDml `protobuf:"bytes,3,opt,name=partitioned_dml,json=partitionedDml,proto3,oneof"` 352} 353 354type TransactionOptions_ReadOnly_ struct { 355 ReadOnly *TransactionOptions_ReadOnly `protobuf:"bytes,2,opt,name=read_only,json=readOnly,proto3,oneof"` 356} 357 358func (*TransactionOptions_ReadWrite_) isTransactionOptions_Mode() {} 359 360func (*TransactionOptions_PartitionedDml_) isTransactionOptions_Mode() {} 361 362func (*TransactionOptions_ReadOnly_) isTransactionOptions_Mode() {} 363 364func (m *TransactionOptions) GetMode() isTransactionOptions_Mode { 365 if m != nil { 366 return m.Mode 367 } 368 return nil 369} 370 371func (m *TransactionOptions) GetReadWrite() *TransactionOptions_ReadWrite { 372 if x, ok := m.GetMode().(*TransactionOptions_ReadWrite_); ok { 373 return x.ReadWrite 374 } 375 return nil 376} 377 378func (m *TransactionOptions) GetPartitionedDml() *TransactionOptions_PartitionedDml { 379 if x, ok := m.GetMode().(*TransactionOptions_PartitionedDml_); ok { 380 return x.PartitionedDml 381 } 382 return nil 383} 384 385func (m *TransactionOptions) GetReadOnly() *TransactionOptions_ReadOnly { 386 if x, ok := m.GetMode().(*TransactionOptions_ReadOnly_); ok { 387 return x.ReadOnly 388 } 389 return nil 390} 391 392// XXX_OneofWrappers is for the internal use of the proto package. 393func (*TransactionOptions) XXX_OneofWrappers() []interface{} { 394 return []interface{}{ 395 (*TransactionOptions_ReadWrite_)(nil), 396 (*TransactionOptions_PartitionedDml_)(nil), 397 (*TransactionOptions_ReadOnly_)(nil), 398 } 399} 400 401// Message type to initiate a read-write transaction. Currently this 402// transaction type has no options. 403type TransactionOptions_ReadWrite struct { 404 XXX_NoUnkeyedLiteral struct{} `json:"-"` 405 XXX_unrecognized []byte `json:"-"` 406 XXX_sizecache int32 `json:"-"` 407} 408 409func (m *TransactionOptions_ReadWrite) Reset() { *m = TransactionOptions_ReadWrite{} } 410func (m *TransactionOptions_ReadWrite) String() string { return proto.CompactTextString(m) } 411func (*TransactionOptions_ReadWrite) ProtoMessage() {} 412func (*TransactionOptions_ReadWrite) Descriptor() ([]byte, []int) { 413 return fileDescriptor_a5743daa0b72b00f, []int{0, 0} 414} 415 416func (m *TransactionOptions_ReadWrite) XXX_Unmarshal(b []byte) error { 417 return xxx_messageInfo_TransactionOptions_ReadWrite.Unmarshal(m, b) 418} 419func (m *TransactionOptions_ReadWrite) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 420 return xxx_messageInfo_TransactionOptions_ReadWrite.Marshal(b, m, deterministic) 421} 422func (m *TransactionOptions_ReadWrite) XXX_Merge(src proto.Message) { 423 xxx_messageInfo_TransactionOptions_ReadWrite.Merge(m, src) 424} 425func (m *TransactionOptions_ReadWrite) XXX_Size() int { 426 return xxx_messageInfo_TransactionOptions_ReadWrite.Size(m) 427} 428func (m *TransactionOptions_ReadWrite) XXX_DiscardUnknown() { 429 xxx_messageInfo_TransactionOptions_ReadWrite.DiscardUnknown(m) 430} 431 432var xxx_messageInfo_TransactionOptions_ReadWrite proto.InternalMessageInfo 433 434// Message type to initiate a Partitioned DML transaction. 435type TransactionOptions_PartitionedDml struct { 436 XXX_NoUnkeyedLiteral struct{} `json:"-"` 437 XXX_unrecognized []byte `json:"-"` 438 XXX_sizecache int32 `json:"-"` 439} 440 441func (m *TransactionOptions_PartitionedDml) Reset() { *m = TransactionOptions_PartitionedDml{} } 442func (m *TransactionOptions_PartitionedDml) String() string { return proto.CompactTextString(m) } 443func (*TransactionOptions_PartitionedDml) ProtoMessage() {} 444func (*TransactionOptions_PartitionedDml) Descriptor() ([]byte, []int) { 445 return fileDescriptor_a5743daa0b72b00f, []int{0, 1} 446} 447 448func (m *TransactionOptions_PartitionedDml) XXX_Unmarshal(b []byte) error { 449 return xxx_messageInfo_TransactionOptions_PartitionedDml.Unmarshal(m, b) 450} 451func (m *TransactionOptions_PartitionedDml) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 452 return xxx_messageInfo_TransactionOptions_PartitionedDml.Marshal(b, m, deterministic) 453} 454func (m *TransactionOptions_PartitionedDml) XXX_Merge(src proto.Message) { 455 xxx_messageInfo_TransactionOptions_PartitionedDml.Merge(m, src) 456} 457func (m *TransactionOptions_PartitionedDml) XXX_Size() int { 458 return xxx_messageInfo_TransactionOptions_PartitionedDml.Size(m) 459} 460func (m *TransactionOptions_PartitionedDml) XXX_DiscardUnknown() { 461 xxx_messageInfo_TransactionOptions_PartitionedDml.DiscardUnknown(m) 462} 463 464var xxx_messageInfo_TransactionOptions_PartitionedDml proto.InternalMessageInfo 465 466// Message type to initiate a read-only transaction. 467type TransactionOptions_ReadOnly struct { 468 // How to choose the timestamp for the read-only transaction. 469 // 470 // Types that are valid to be assigned to TimestampBound: 471 // *TransactionOptions_ReadOnly_Strong 472 // *TransactionOptions_ReadOnly_MinReadTimestamp 473 // *TransactionOptions_ReadOnly_MaxStaleness 474 // *TransactionOptions_ReadOnly_ReadTimestamp 475 // *TransactionOptions_ReadOnly_ExactStaleness 476 TimestampBound isTransactionOptions_ReadOnly_TimestampBound `protobuf_oneof:"timestamp_bound"` 477 // If true, the Cloud Spanner-selected read timestamp is included in 478 // the [Transaction][google.spanner.v1.Transaction] message that describes the transaction. 479 ReturnReadTimestamp bool `protobuf:"varint,6,opt,name=return_read_timestamp,json=returnReadTimestamp,proto3" json:"return_read_timestamp,omitempty"` 480 XXX_NoUnkeyedLiteral struct{} `json:"-"` 481 XXX_unrecognized []byte `json:"-"` 482 XXX_sizecache int32 `json:"-"` 483} 484 485func (m *TransactionOptions_ReadOnly) Reset() { *m = TransactionOptions_ReadOnly{} } 486func (m *TransactionOptions_ReadOnly) String() string { return proto.CompactTextString(m) } 487func (*TransactionOptions_ReadOnly) ProtoMessage() {} 488func (*TransactionOptions_ReadOnly) Descriptor() ([]byte, []int) { 489 return fileDescriptor_a5743daa0b72b00f, []int{0, 2} 490} 491 492func (m *TransactionOptions_ReadOnly) XXX_Unmarshal(b []byte) error { 493 return xxx_messageInfo_TransactionOptions_ReadOnly.Unmarshal(m, b) 494} 495func (m *TransactionOptions_ReadOnly) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 496 return xxx_messageInfo_TransactionOptions_ReadOnly.Marshal(b, m, deterministic) 497} 498func (m *TransactionOptions_ReadOnly) XXX_Merge(src proto.Message) { 499 xxx_messageInfo_TransactionOptions_ReadOnly.Merge(m, src) 500} 501func (m *TransactionOptions_ReadOnly) XXX_Size() int { 502 return xxx_messageInfo_TransactionOptions_ReadOnly.Size(m) 503} 504func (m *TransactionOptions_ReadOnly) XXX_DiscardUnknown() { 505 xxx_messageInfo_TransactionOptions_ReadOnly.DiscardUnknown(m) 506} 507 508var xxx_messageInfo_TransactionOptions_ReadOnly proto.InternalMessageInfo 509 510type isTransactionOptions_ReadOnly_TimestampBound interface { 511 isTransactionOptions_ReadOnly_TimestampBound() 512} 513 514type TransactionOptions_ReadOnly_Strong struct { 515 Strong bool `protobuf:"varint,1,opt,name=strong,proto3,oneof"` 516} 517 518type TransactionOptions_ReadOnly_MinReadTimestamp struct { 519 MinReadTimestamp *timestamp.Timestamp `protobuf:"bytes,2,opt,name=min_read_timestamp,json=minReadTimestamp,proto3,oneof"` 520} 521 522type TransactionOptions_ReadOnly_MaxStaleness struct { 523 MaxStaleness *duration.Duration `protobuf:"bytes,3,opt,name=max_staleness,json=maxStaleness,proto3,oneof"` 524} 525 526type TransactionOptions_ReadOnly_ReadTimestamp struct { 527 ReadTimestamp *timestamp.Timestamp `protobuf:"bytes,4,opt,name=read_timestamp,json=readTimestamp,proto3,oneof"` 528} 529 530type TransactionOptions_ReadOnly_ExactStaleness struct { 531 ExactStaleness *duration.Duration `protobuf:"bytes,5,opt,name=exact_staleness,json=exactStaleness,proto3,oneof"` 532} 533 534func (*TransactionOptions_ReadOnly_Strong) isTransactionOptions_ReadOnly_TimestampBound() {} 535 536func (*TransactionOptions_ReadOnly_MinReadTimestamp) isTransactionOptions_ReadOnly_TimestampBound() {} 537 538func (*TransactionOptions_ReadOnly_MaxStaleness) isTransactionOptions_ReadOnly_TimestampBound() {} 539 540func (*TransactionOptions_ReadOnly_ReadTimestamp) isTransactionOptions_ReadOnly_TimestampBound() {} 541 542func (*TransactionOptions_ReadOnly_ExactStaleness) isTransactionOptions_ReadOnly_TimestampBound() {} 543 544func (m *TransactionOptions_ReadOnly) GetTimestampBound() isTransactionOptions_ReadOnly_TimestampBound { 545 if m != nil { 546 return m.TimestampBound 547 } 548 return nil 549} 550 551func (m *TransactionOptions_ReadOnly) GetStrong() bool { 552 if x, ok := m.GetTimestampBound().(*TransactionOptions_ReadOnly_Strong); ok { 553 return x.Strong 554 } 555 return false 556} 557 558func (m *TransactionOptions_ReadOnly) GetMinReadTimestamp() *timestamp.Timestamp { 559 if x, ok := m.GetTimestampBound().(*TransactionOptions_ReadOnly_MinReadTimestamp); ok { 560 return x.MinReadTimestamp 561 } 562 return nil 563} 564 565func (m *TransactionOptions_ReadOnly) GetMaxStaleness() *duration.Duration { 566 if x, ok := m.GetTimestampBound().(*TransactionOptions_ReadOnly_MaxStaleness); ok { 567 return x.MaxStaleness 568 } 569 return nil 570} 571 572func (m *TransactionOptions_ReadOnly) GetReadTimestamp() *timestamp.Timestamp { 573 if x, ok := m.GetTimestampBound().(*TransactionOptions_ReadOnly_ReadTimestamp); ok { 574 return x.ReadTimestamp 575 } 576 return nil 577} 578 579func (m *TransactionOptions_ReadOnly) GetExactStaleness() *duration.Duration { 580 if x, ok := m.GetTimestampBound().(*TransactionOptions_ReadOnly_ExactStaleness); ok { 581 return x.ExactStaleness 582 } 583 return nil 584} 585 586func (m *TransactionOptions_ReadOnly) GetReturnReadTimestamp() bool { 587 if m != nil { 588 return m.ReturnReadTimestamp 589 } 590 return false 591} 592 593// XXX_OneofWrappers is for the internal use of the proto package. 594func (*TransactionOptions_ReadOnly) XXX_OneofWrappers() []interface{} { 595 return []interface{}{ 596 (*TransactionOptions_ReadOnly_Strong)(nil), 597 (*TransactionOptions_ReadOnly_MinReadTimestamp)(nil), 598 (*TransactionOptions_ReadOnly_MaxStaleness)(nil), 599 (*TransactionOptions_ReadOnly_ReadTimestamp)(nil), 600 (*TransactionOptions_ReadOnly_ExactStaleness)(nil), 601 } 602} 603 604// A transaction. 605type Transaction struct { 606 // `id` may be used to identify the transaction in subsequent 607 // [Read][google.spanner.v1.Spanner.Read], 608 // [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], 609 // [Commit][google.spanner.v1.Spanner.Commit], or 610 // [Rollback][google.spanner.v1.Spanner.Rollback] calls. 611 // 612 // Single-use read-only transactions do not have IDs, because 613 // single-use transactions do not support multiple requests. 614 Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` 615 // For snapshot read-only transactions, the read timestamp chosen 616 // for the transaction. Not returned by default: see 617 // [TransactionOptions.ReadOnly.return_read_timestamp][google.spanner.v1.TransactionOptions.ReadOnly.return_read_timestamp]. 618 // 619 // A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. 620 // Example: `"2014-10-02T15:01:23.045123456Z"`. 621 ReadTimestamp *timestamp.Timestamp `protobuf:"bytes,2,opt,name=read_timestamp,json=readTimestamp,proto3" json:"read_timestamp,omitempty"` 622 XXX_NoUnkeyedLiteral struct{} `json:"-"` 623 XXX_unrecognized []byte `json:"-"` 624 XXX_sizecache int32 `json:"-"` 625} 626 627func (m *Transaction) Reset() { *m = Transaction{} } 628func (m *Transaction) String() string { return proto.CompactTextString(m) } 629func (*Transaction) ProtoMessage() {} 630func (*Transaction) Descriptor() ([]byte, []int) { 631 return fileDescriptor_a5743daa0b72b00f, []int{1} 632} 633 634func (m *Transaction) XXX_Unmarshal(b []byte) error { 635 return xxx_messageInfo_Transaction.Unmarshal(m, b) 636} 637func (m *Transaction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 638 return xxx_messageInfo_Transaction.Marshal(b, m, deterministic) 639} 640func (m *Transaction) XXX_Merge(src proto.Message) { 641 xxx_messageInfo_Transaction.Merge(m, src) 642} 643func (m *Transaction) XXX_Size() int { 644 return xxx_messageInfo_Transaction.Size(m) 645} 646func (m *Transaction) XXX_DiscardUnknown() { 647 xxx_messageInfo_Transaction.DiscardUnknown(m) 648} 649 650var xxx_messageInfo_Transaction proto.InternalMessageInfo 651 652func (m *Transaction) GetId() []byte { 653 if m != nil { 654 return m.Id 655 } 656 return nil 657} 658 659func (m *Transaction) GetReadTimestamp() *timestamp.Timestamp { 660 if m != nil { 661 return m.ReadTimestamp 662 } 663 return nil 664} 665 666// This message is used to select the transaction in which a 667// [Read][google.spanner.v1.Spanner.Read] or 668// [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] call runs. 669// 670// See [TransactionOptions][google.spanner.v1.TransactionOptions] for more information about transactions. 671type TransactionSelector struct { 672 // If no fields are set, the default is a single use transaction 673 // with strong concurrency. 674 // 675 // Types that are valid to be assigned to Selector: 676 // *TransactionSelector_SingleUse 677 // *TransactionSelector_Id 678 // *TransactionSelector_Begin 679 Selector isTransactionSelector_Selector `protobuf_oneof:"selector"` 680 XXX_NoUnkeyedLiteral struct{} `json:"-"` 681 XXX_unrecognized []byte `json:"-"` 682 XXX_sizecache int32 `json:"-"` 683} 684 685func (m *TransactionSelector) Reset() { *m = TransactionSelector{} } 686func (m *TransactionSelector) String() string { return proto.CompactTextString(m) } 687func (*TransactionSelector) ProtoMessage() {} 688func (*TransactionSelector) Descriptor() ([]byte, []int) { 689 return fileDescriptor_a5743daa0b72b00f, []int{2} 690} 691 692func (m *TransactionSelector) XXX_Unmarshal(b []byte) error { 693 return xxx_messageInfo_TransactionSelector.Unmarshal(m, b) 694} 695func (m *TransactionSelector) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 696 return xxx_messageInfo_TransactionSelector.Marshal(b, m, deterministic) 697} 698func (m *TransactionSelector) XXX_Merge(src proto.Message) { 699 xxx_messageInfo_TransactionSelector.Merge(m, src) 700} 701func (m *TransactionSelector) XXX_Size() int { 702 return xxx_messageInfo_TransactionSelector.Size(m) 703} 704func (m *TransactionSelector) XXX_DiscardUnknown() { 705 xxx_messageInfo_TransactionSelector.DiscardUnknown(m) 706} 707 708var xxx_messageInfo_TransactionSelector proto.InternalMessageInfo 709 710type isTransactionSelector_Selector interface { 711 isTransactionSelector_Selector() 712} 713 714type TransactionSelector_SingleUse struct { 715 SingleUse *TransactionOptions `protobuf:"bytes,1,opt,name=single_use,json=singleUse,proto3,oneof"` 716} 717 718type TransactionSelector_Id struct { 719 Id []byte `protobuf:"bytes,2,opt,name=id,proto3,oneof"` 720} 721 722type TransactionSelector_Begin struct { 723 Begin *TransactionOptions `protobuf:"bytes,3,opt,name=begin,proto3,oneof"` 724} 725 726func (*TransactionSelector_SingleUse) isTransactionSelector_Selector() {} 727 728func (*TransactionSelector_Id) isTransactionSelector_Selector() {} 729 730func (*TransactionSelector_Begin) isTransactionSelector_Selector() {} 731 732func (m *TransactionSelector) GetSelector() isTransactionSelector_Selector { 733 if m != nil { 734 return m.Selector 735 } 736 return nil 737} 738 739func (m *TransactionSelector) GetSingleUse() *TransactionOptions { 740 if x, ok := m.GetSelector().(*TransactionSelector_SingleUse); ok { 741 return x.SingleUse 742 } 743 return nil 744} 745 746func (m *TransactionSelector) GetId() []byte { 747 if x, ok := m.GetSelector().(*TransactionSelector_Id); ok { 748 return x.Id 749 } 750 return nil 751} 752 753func (m *TransactionSelector) GetBegin() *TransactionOptions { 754 if x, ok := m.GetSelector().(*TransactionSelector_Begin); ok { 755 return x.Begin 756 } 757 return nil 758} 759 760// XXX_OneofWrappers is for the internal use of the proto package. 761func (*TransactionSelector) XXX_OneofWrappers() []interface{} { 762 return []interface{}{ 763 (*TransactionSelector_SingleUse)(nil), 764 (*TransactionSelector_Id)(nil), 765 (*TransactionSelector_Begin)(nil), 766 } 767} 768 769func init() { 770 proto.RegisterType((*TransactionOptions)(nil), "google.spanner.v1.TransactionOptions") 771 proto.RegisterType((*TransactionOptions_ReadWrite)(nil), "google.spanner.v1.TransactionOptions.ReadWrite") 772 proto.RegisterType((*TransactionOptions_PartitionedDml)(nil), "google.spanner.v1.TransactionOptions.PartitionedDml") 773 proto.RegisterType((*TransactionOptions_ReadOnly)(nil), "google.spanner.v1.TransactionOptions.ReadOnly") 774 proto.RegisterType((*Transaction)(nil), "google.spanner.v1.Transaction") 775 proto.RegisterType((*TransactionSelector)(nil), "google.spanner.v1.TransactionSelector") 776} 777 778func init() { 779 proto.RegisterFile("google/spanner/v1/transaction.proto", fileDescriptor_a5743daa0b72b00f) 780} 781 782var fileDescriptor_a5743daa0b72b00f = []byte{ 783 // 571 bytes of a gzipped FileDescriptorProto 784 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0x5f, 0x8b, 0xd3, 0x4c, 785 0x14, 0xc6, 0xd3, 0xee, 0x6e, 0xe9, 0x9e, 0x76, 0xdb, 0xee, 0x2c, 0xcb, 0xdb, 0x37, 0x88, 0x4a, 786 0x45, 0xf0, 0x2a, 0xa1, 0xab, 0x17, 0x82, 0x08, 0xda, 0x2d, 0x1a, 0x04, 0xd9, 0x92, 0xae, 0x2b, 787 0x48, 0x21, 0x4e, 0x9b, 0x31, 0x0c, 0x24, 0x33, 0x61, 0x66, 0xb2, 0x76, 0xef, 0xfd, 0x12, 0x7e, 788 0x05, 0x3f, 0x82, 0xd7, 0x5e, 0xf9, 0xa9, 0x24, 0x93, 0x49, 0xff, 0xe5, 0x62, 0x7b, 0x97, 0xe4, 789 0x3c, 0xcf, 0x73, 0x7e, 0x73, 0x4e, 0x12, 0x78, 0x12, 0x71, 0x1e, 0xc5, 0xc4, 0x95, 0x29, 0x66, 790 0x8c, 0x08, 0xf7, 0x76, 0xe8, 0x2a, 0x81, 0x99, 0xc4, 0x0b, 0x45, 0x39, 0x73, 0x52, 0xc1, 0x15, 791 0x47, 0xa7, 0x85, 0xc8, 0x31, 0x22, 0xe7, 0x76, 0x68, 0x3f, 0x34, 0x3e, 0x2d, 0x98, 0x67, 0xdf, 792 0xdc, 0x30, 0x13, 0x78, 0x6d, 0xb1, 0x1f, 0xed, 0xd6, 0x15, 0x4d, 0x88, 0x54, 0x38, 0x49, 0x8d, 793 0xe0, 0x81, 0x11, 0xe0, 0x94, 0xba, 0x98, 0x31, 0xae, 0xb4, 0x5b, 0x16, 0xd5, 0xc1, 0x9f, 0x23, 794 0x40, 0xd7, 0x6b, 0x8e, 0xab, 0x54, 0x17, 0xd1, 0x04, 0x40, 0x10, 0x1c, 0x06, 0xdf, 0x05, 0x55, 795 0xa4, 0x5f, 0x7b, 0x5c, 0x7b, 0xd6, 0xba, 0x70, 0x9d, 0x0a, 0x9d, 0x53, 0xb5, 0x3a, 0x3e, 0xc1, 796 0xe1, 0xe7, 0xdc, 0xe6, 0x59, 0xfe, 0xb1, 0x28, 0x6f, 0x50, 0x00, 0xdd, 0x14, 0x0b, 0x45, 0x73, 797 0x11, 0x09, 0x83, 0x30, 0x89, 0xfb, 0x07, 0x3a, 0xf6, 0xc5, 0x7e, 0xb1, 0x93, 0xb5, 0x79, 0x9c, 798 0xc4, 0x9e, 0xe5, 0x77, 0xd2, 0xad, 0x27, 0xe8, 0x23, 0xe8, 0x6e, 0x01, 0x67, 0xf1, 0x5d, 0xbf, 799 0xae, 0xa3, 0x9d, 0xfd, 0x89, 0xaf, 0x58, 0x7c, 0xe7, 0x59, 0x7e, 0x53, 0x98, 0x6b, 0xbb, 0x05, 800 0xc7, 0xab, 0x93, 0xd8, 0x3d, 0xe8, 0x6c, 0xf7, 0xb7, 0x7f, 0x1c, 0x40, 0xb3, 0xf4, 0xa1, 0x3e, 801 0x34, 0xa4, 0x12, 0x9c, 0x45, 0x7a, 0x52, 0x4d, 0xcf, 0xf2, 0xcd, 0x3d, 0xfa, 0x00, 0x28, 0xa1, 802 0x2c, 0xd0, 0x60, 0xab, 0xc5, 0x18, 0x3a, 0xbb, 0xa4, 0x2b, 0x57, 0xe7, 0x5c, 0x97, 0x0a, 0xcf, 803 0xf2, 0x7b, 0x09, 0x65, 0x79, 0x83, 0xd5, 0x33, 0xf4, 0x06, 0x4e, 0x12, 0xbc, 0x0c, 0xa4, 0xc2, 804 0x31, 0x61, 0x44, 0x4a, 0x33, 0xbf, 0xff, 0x2b, 0x31, 0x63, 0xf3, 0x86, 0x78, 0x96, 0xdf, 0x4e, 805 0xf0, 0x72, 0x5a, 0x1a, 0xd0, 0x25, 0x74, 0x76, 0x48, 0x0e, 0xf7, 0x20, 0x39, 0x11, 0x5b, 0x18, 806 0x63, 0xe8, 0x92, 0x25, 0x5e, 0xa8, 0x0d, 0x90, 0xa3, 0xfb, 0x41, 0x3a, 0xda, 0xb3, 0x46, 0xb9, 807 0x80, 0x73, 0x41, 0x54, 0x26, 0x2a, 0xb3, 0x69, 0xe4, 0x13, 0xf4, 0xcf, 0x8a, 0xe2, 0xd6, 0x00, 808 0x46, 0xa7, 0xd0, 0x5d, 0xe9, 0x82, 0x39, 0xcf, 0x58, 0x38, 0x6a, 0xc0, 0x61, 0xc2, 0x43, 0x32, 809 0xf8, 0x0a, 0xad, 0x8d, 0xc5, 0xa2, 0x0e, 0xd4, 0x69, 0xa8, 0x97, 0xd1, 0xf6, 0xeb, 0x34, 0x44, 810 0x6f, 0x2b, 0x07, 0xbf, 0x77, 0x05, 0x3b, 0xc7, 0x1e, 0xfc, 0xae, 0xc1, 0xd9, 0x46, 0x8b, 0x29, 811 0x89, 0xc9, 0x42, 0x71, 0x81, 0xde, 0x01, 0x48, 0xca, 0xa2, 0x98, 0x04, 0x99, 0x2c, 0xbf, 0x94, 812 0xa7, 0x7b, 0xbd, 0x77, 0xf9, 0xf7, 0x51, 0x58, 0x3f, 0x49, 0x82, 0x7a, 0x1a, 0x39, 0xc7, 0x6a, 813 0x7b, 0x96, 0x86, 0x7e, 0x0d, 0x47, 0x73, 0x12, 0x51, 0x66, 0xf6, 0xbc, 0x77, 0x68, 0xe1, 0x1a, 814 0x01, 0x34, 0xa5, 0x81, 0x1c, 0xfd, 0xac, 0xc1, 0xf9, 0x82, 0x27, 0xd5, 0x84, 0x51, 0x6f, 0x23, 815 0x62, 0x92, 0x0f, 0x61, 0x52, 0xfb, 0xf2, 0xd2, 0xc8, 0x22, 0x1e, 0x63, 0x16, 0x39, 0x5c, 0x44, 816 0x6e, 0x44, 0x98, 0x1e, 0x91, 0x5b, 0x94, 0x70, 0x4a, 0xe5, 0xc6, 0x9f, 0xec, 0x95, 0xb9, 0xfc, 817 0x55, 0xff, 0xef, 0x7d, 0x61, 0xbd, 0x8c, 0x79, 0x16, 0x3a, 0x53, 0xd3, 0xe7, 0x66, 0xf8, 0xb7, 818 0xac, 0xcc, 0x74, 0x65, 0x66, 0x2a, 0xb3, 0x9b, 0xe1, 0xbc, 0xa1, 0x83, 0x9f, 0xff, 0x0b, 0x00, 819 0x00, 0xff, 0xff, 0x5a, 0x1b, 0xee, 0x19, 0x21, 0x05, 0x00, 0x00, 820} 821