Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Adding two new fields for Instance create_time and update_time #1641

Merged
merged 11 commits into from
Jul 4, 2022
2 changes: 1 addition & 1 deletion protos/google/spanner/v1/commit_response.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Google LLC
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion protos/google/spanner/v1/keys.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Google LLC
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion protos/google/spanner/v1/mutation.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Google LLC
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion protos/google/spanner/v1/query_plan.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Google LLC
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
3 changes: 1 addition & 2 deletions protos/google/spanner/v1/result_set.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Google LLC
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -17,7 +17,6 @@ syntax = "proto3";
package google.spanner.v1;

import "google/protobuf/struct.proto";
import "google/spanner/v1/commit_response.proto";
import "google/spanner/v1/query_plan.proto";
import "google/spanner/v1/transaction.proto";
import "google/spanner/v1/type.proto";
Expand Down
5 changes: 4 additions & 1 deletion protos/google/spanner/v1/spanner.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Google LLC
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -358,6 +358,9 @@ message Session {
// Output only. The approximate timestamp when the session is last used. It is
// typically earlier than the actual last use time.
google.protobuf.Timestamp approximate_last_use_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];

// The database role which created this session.
string creator_role = 5;
}

// The request for [GetSession][google.spanner.v1.Spanner.GetSession].
Expand Down
94 changes: 73 additions & 21 deletions protos/google/spanner/v1/transaction.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Google LLC
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -35,7 +35,8 @@ option ruby_package = "Google::Cloud::Spanner::V1";
// completed, the session can immediately be re-used for the next transaction.
// It is not necessary to create a new session for each transaction.
//
// Transaction Modes:
// Transaction modes:
//
// Cloud Spanner supports three transaction modes:
//
// 1. Locking read-write. This type of transaction is the only way
Expand All @@ -44,11 +45,18 @@ option ruby_package = "Google::Cloud::Spanner::V1";
// Locking read-write transactions may abort, requiring the
// application to retry.
//
// 2. Snapshot read-only. This transaction type provides guaranteed
// consistency across several reads, but does not allow
// writes. Snapshot read-only transactions can be configured to
// read at timestamps in the past. Snapshot read-only
// transactions do not need to be committed.
// 2. Snapshot read-only. Snapshot read-only transactions provide guaranteed
// consistency across several reads, but do not allow
// writes. Snapshot read-only transactions can be configured to read at
// timestamps in the past, or configured to perform a strong read
// (where Spanner will select a timestamp such that the read is
// guaranteed to see the effects of all transactions that have committed
// before the start of the read). Snapshot read-only transactions do not
// need to be committed.
//
// Queries on change streams must be performed with the snapshot read-only
// transaction mode, specifying a strong read. Please see
// [TransactionOptions.ReadOnly.strong][google.spanner.v1.TransactionOptions.ReadOnly.strong] for more details.
//
// 3. Partitioned DML. This type of transaction is used to execute
// a single Partitioned DML statement. Partitioned DML partitions
Expand All @@ -63,11 +71,12 @@ option ruby_package = "Google::Cloud::Spanner::V1";
// not conflict with read-write transactions. As a consequence of not
// taking locks, they also do not abort, so retry loops are not needed.
//
// Transactions may only read/write data in a single database. They
// may, however, read/write data in different tables within that
// Transactions may only read-write data in a single database. They
// may, however, read-write data in different tables within that
// database.
//
// Locking Read-Write Transactions:
// Locking read-write transactions:
//
// Locking transactions may be used to atomically read-modify-write
// data anywhere in a database. This type of transaction is externally
// consistent.
Expand All @@ -78,7 +87,7 @@ option ruby_package = "Google::Cloud::Spanner::V1";
// active as long as the transaction continues to do reads, and the
// transaction has not been terminated by
// [Commit][google.spanner.v1.Spanner.Commit] or
// [Rollback][google.spanner.v1.Spanner.Rollback]. Long periods of
// [Rollback][google.spanner.v1.Spanner.Rollback]. Long periods of
// inactivity at the client may cause Cloud Spanner to release a
// transaction's locks and abort it.
//
Expand All @@ -90,6 +99,7 @@ option ruby_package = "Google::Cloud::Spanner::V1";
// transaction.
//
// Semantics:
//
// Cloud Spanner can commit the transaction if all read locks it acquired
// are still valid at commit time, and it is able to acquire write
// locks for all writes. Cloud Spanner can abort the transaction for any
Expand All @@ -101,7 +111,8 @@ option ruby_package = "Google::Cloud::Spanner::V1";
// use Cloud Spanner locks for any sort of mutual exclusion other than
// between Cloud Spanner transactions themselves.
//
// Retrying Aborted Transactions:
// Retrying aborted transactions:
//
// When a transaction aborts, the application can choose to retry the
// whole transaction again. To maximize the chances of successfully
// committing the retry, the client should execute the retry in the
Expand All @@ -116,7 +127,8 @@ option ruby_package = "Google::Cloud::Spanner::V1";
// instead, it is better to limit the total amount of time spent
// retrying.
//
// Idle Transactions:
// Idle transactions:
//
// A transaction is considered idle if it has no outstanding reads or
// SQL queries and has not started a read or SQL query within the last 10
// seconds. Idle transactions can be aborted by Cloud Spanner so that they
Expand All @@ -127,7 +139,8 @@ option ruby_package = "Google::Cloud::Spanner::V1";
// SQL query in the transaction (for example, `SELECT 1`) prevents the
// transaction from becoming idle.
//
// Snapshot Read-Only Transactions:
// Snapshot read-only transactions:
//
// Snapshot read-only transactions provides a simpler method than
// locking read-write transactions for doing several consistent
// reads. However, this type of transaction does not support writes.
Expand Down Expand Up @@ -159,13 +172,12 @@ option ruby_package = "Google::Cloud::Spanner::V1";
//
// If the Cloud Spanner database to be read is geographically distributed,
// stale read-only transactions can execute more quickly than strong
// or read-write transaction, because they are able to execute far
// or read-write transactions, because they are able to execute far
// from the leader replica.
//
// Each type of timestamp bound is discussed in detail below.
//
// Strong:
// Strong reads are guaranteed to see the effects of all transactions
// Strong: Strong reads are guaranteed to see the effects of all transactions
// that have committed before the start of the read. Furthermore, all
// rows yielded by a single read are consistent with each other -- if
// any part of the read observes a transaction, all parts of the read
Expand All @@ -177,9 +189,13 @@ option ruby_package = "Google::Cloud::Spanner::V1";
// reads should be executed within a transaction or at an exact read
// timestamp.
//
// Queries on change streams (see below for more details) must also specify
// the strong read timestamp bound.
//
// See [TransactionOptions.ReadOnly.strong][google.spanner.v1.TransactionOptions.ReadOnly.strong].
//
// Exact Staleness:
// Exact staleness:
//
// These timestamp bounds execute reads at a user-specified
// timestamp. Reads at a timestamp are guaranteed to see a consistent
// prefix of the global transaction history: they observe
Expand All @@ -200,7 +216,8 @@ option ruby_package = "Google::Cloud::Spanner::V1";
// See [TransactionOptions.ReadOnly.read_timestamp][google.spanner.v1.TransactionOptions.ReadOnly.read_timestamp] and
// [TransactionOptions.ReadOnly.exact_staleness][google.spanner.v1.TransactionOptions.ReadOnly.exact_staleness].
//
// Bounded Staleness:
// Bounded staleness:
//
// Bounded staleness modes allow Cloud Spanner to pick the read timestamp,
// subject to a user-provided staleness bound. Cloud Spanner chooses the
// newest timestamp within the staleness bound that allows execution
Expand Down Expand Up @@ -229,7 +246,8 @@ option ruby_package = "Google::Cloud::Spanner::V1";
// See [TransactionOptions.ReadOnly.max_staleness][google.spanner.v1.TransactionOptions.ReadOnly.max_staleness] and
// [TransactionOptions.ReadOnly.min_read_timestamp][google.spanner.v1.TransactionOptions.ReadOnly.min_read_timestamp].
//
// Old Read Timestamps and Garbage Collection:
// Old read timestamps and garbage collection:
//
// Cloud Spanner continuously garbage collects deleted and overwritten data
// in the background to reclaim storage space. This process is known
// as "version GC". By default, version GC reclaims versions after they
Expand All @@ -239,7 +257,41 @@ option ruby_package = "Google::Cloud::Spanner::V1";
// timestamp become too old while executing. Reads and SQL queries with
// too-old read timestamps fail with the error `FAILED_PRECONDITION`.
//
// Partitioned DML Transactions:
// You can configure and extend the `VERSION_RETENTION_PERIOD` of a
// database up to a period as long as one week, which allows Cloud Spanner
// to perform reads up to one week in the past.
//
// Querying change Streams:
//
// A Change Stream is a schema object that can be configured to watch data
// changes on the entire database, a set of tables, or a set of columns
// in a database.
//
// When a change stream is created, Spanner automatically defines a
// corresponding SQL Table-Valued Function (TVF) that can be used to query
// the change records in the associated change stream using the
// ExecuteStreamingSql API. The name of the TVF for a change stream is
// generated from the name of the change stream: READ_<change_stream_name>.
//
// All queries on change stream TVFs must be executed using the
// ExecuteStreamingSql API with a single-use read-only transaction with a
// strong read-only timestamp_bound. The change stream TVF allows users to
// specify the start_timestamp and end_timestamp for the time range of
// interest. All change records within the retention period is accessible
// using the strong read-only timestamp_bound. All other TransactionOptions
// are invalid for change stream queries.
//
// In addition, if TransactionOptions.read_only.return_read_timestamp is set
// to true, a special value of 2^63 - 2 will be returned in the
// [Transaction][google.spanner.v1.Transaction] message that describes the
// transaction, instead of a valid read timestamp. This special value should be
// discarded and not used for any subsequent queries.
//
// Please see https://cloud.google.com/spanner/docs/change-streams
// for more details on how to query the change stream TVFs.
//
// Partitioned DML transactions:
//
// Partitioned DML transactions are used to execute DML statements with a
// different execution strategy that provides different, and often better,
// scalability properties for large, table-wide operations than DML in a
Expand Down
2 changes: 1 addition & 1 deletion protos/google/spanner/v1/type.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Google LLC
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
6 changes: 6 additions & 0 deletions protos/protos.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions protos/protos.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions protos/protos.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.