Skip to content

Commit

Permalink
feat(spanner): add directed_read_option in spanner.proto (googleapis#…
Browse files Browse the repository at this point in the history
…6759)

docs(spanner): updated comment formatting
PiperOrigin-RevId: 578551679
Source-Link: googleapis/googleapis@7c80b96
Source-Link: https://github.com/googleapis/googleapis-gen/commit/7b1172ba5e020eaef7de75062a576a11b8e117e4
Copy-Tag: eyJwIjoiU3Bhbm5lci8uT3dsQm90LnlhbWwiLCJoIjoiN2IxMTcyYmE1ZTAyMGVhZWY3ZGU3NTA2MmE1NzZhMTFiOGUxMTdlNCJ9
  • Loading branch information
gcf-owl-bot[bot] authored Nov 2, 2023
1 parent cf4188d commit 6b5bb82
Show file tree
Hide file tree
Showing 31 changed files with 1,228 additions and 447 deletions.
Binary file modified Spanner/metadata/V1/Spanner.php
Binary file not shown.
3 changes: 2 additions & 1 deletion Spanner/samples/V1/SpannerClient/batch_create_sessions.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
* The API may return fewer than the requested number of sessions. If a
* specific number of sessions are desired, the client can make additional
* calls to BatchCreateSessions (adjusting
* [session_count][google.spanner.v1.BatchCreateSessionsRequest.session_count] as necessary).
* [session_count][google.spanner.v1.BatchCreateSessionsRequest.session_count]
* as necessary).
*/
function batch_create_sessions_sample(string $formattedDatabase, int $sessionCount): void
{
Expand Down
3 changes: 2 additions & 1 deletion Spanner/samples/V1/SpannerClient/begin_transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@

/**
* Begins a new transaction. This step can often be skipped:
* [Read][google.spanner.v1.Spanner.Read], [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and
* [Read][google.spanner.v1.Spanner.Read],
* [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and
* [Commit][google.spanner.v1.Spanner.Commit] can begin a new transaction as a
* side-effect.
*
Expand Down
13 changes: 7 additions & 6 deletions Spanner/samples/V1/SpannerClient/execute_batch_dml.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,20 @@
* [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql].
*
* Statements are executed in sequential order. A request can succeed even if
* a statement fails. The [ExecuteBatchDmlResponse.status][google.spanner.v1.ExecuteBatchDmlResponse.status] field in the
* response provides information about the statement that failed. Clients must
* inspect this field to determine whether an error occurred.
* a statement fails. The
* [ExecuteBatchDmlResponse.status][google.spanner.v1.ExecuteBatchDmlResponse.status]
* field in the response provides information about the statement that failed.
* Clients must inspect this field to determine whether an error occurred.
*
* Execution stops after the first failed statement; the remaining statements
* are not executed.
*
* @param string $formattedSession The session in which the DML statements should be performed. Please see
* {@see SpannerClient::sessionName()} for help formatting this field.
* @param string $statementsSql The DML string.
* @param int $seqno A per-transaction sequence number used to identify this request. This field
* makes each request idempotent such that if the request is received multiple
* times, at most one will succeed.
* @param int $seqno A per-transaction sequence number used to identify this request.
* This field makes each request idempotent such that if the request is
* received multiple times, at most one will succeed.
*
* The sequence number must be monotonically increasing within the
* transaction. If a request arrives for the first time with an out-of-order
Expand Down
6 changes: 4 additions & 2 deletions Spanner/samples/V1/SpannerClient/execute_sql.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@
*
* Operations inside read-write transactions might return `ABORTED`. If
* this occurs, the application should restart the transaction from
* the beginning. See [Transaction][google.spanner.v1.Transaction] for more details.
* the beginning. See [Transaction][google.spanner.v1.Transaction] for more
* details.
*
* Larger result sets can be fetched in streaming fashion by calling
* [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] instead.
* [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql]
* instead.
*
* @param string $formattedSession The session in which the SQL query should be performed. Please see
* {@see SpannerClient::sessionName()} for help formatting this field.
Expand Down
10 changes: 5 additions & 5 deletions Spanner/samples/V1/SpannerClient/execute_streaming_sql.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
use Google\Cloud\Spanner\V1\SpannerClient;

/**
* Like [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], except returns the result
* set as a stream. Unlike [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], there
* is no limit on the size of the returned result set. However, no
* individual row in the result set can exceed 100 MiB, and no
* column value can exceed 10 MiB.
* Like [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], except returns the
* result set as a stream. Unlike
* [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], there is no limit on
* the size of the returned result set. However, no individual row in the
* result set can exceed 100 MiB, and no column value can exceed 10 MiB.
*
* @param string $formattedSession The session in which the SQL query should be performed. Please see
* {@see SpannerClient::sessionName()} for help formatting this field.
Expand Down
26 changes: 14 additions & 12 deletions Spanner/samples/V1/SpannerClient/partition_query.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@
/**
* Creates a set of partition tokens that can be used to execute a query
* operation in parallel. Each of the returned partition tokens can be used
* by [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] to specify a subset
* of the query result to read. The same session and read-only transaction
* must be used by the PartitionQueryRequest used to create the
* partition tokens and the ExecuteSqlRequests that use the partition tokens.
* by [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] to
* specify a subset of the query result to read. The same session and
* read-only transaction must be used by the PartitionQueryRequest used to
* create the partition tokens and the ExecuteSqlRequests that use the
* partition tokens.
*
* Partition tokens become invalid when the session used to create them
* is deleted, is idle for too long, begins a new transaction, or becomes too
Expand All @@ -42,15 +43,16 @@
*
* @param string $formattedSession The session used to create the partitions. Please see
* {@see SpannerClient::sessionName()} for help formatting this field.
* @param string $sql The query request to generate partitions for. The request will fail if
* the query is not root partitionable. The query plan of a root
* partitionable query has a single distributed union operator. A distributed
* union operator conceptually divides one or more tables into multiple
* splits, remotely evaluates a subquery independently on each split, and
* then unions all results.
* @param string $sql The query request to generate partitions for. The request will
* fail if the query is not root partitionable. For a query to be root
* partitionable, it needs to satisfy a few conditions. For example, the first
* operator in the query execution plan must be a distributed union operator.
* For more information about other conditions, see [Read data in
* parallel](https://cloud.google.com/spanner/docs/reads#read_data_in_parallel).
*
* This must not contain DML commands, such as INSERT, UPDATE, or
* DELETE. Use [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] with a
* The query request must not contain DML commands, such as INSERT, UPDATE, or
* DELETE. Use
* [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] with a
* PartitionedDml transaction for large, partition-friendly DML operations.
*/
function partition_query_sample(string $formattedSession, string $sql): void
Expand Down
13 changes: 7 additions & 6 deletions Spanner/samples/V1/SpannerClient/partition_read.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@
/**
* Creates a set of partition tokens that can be used to execute a read
* operation in parallel. Each of the returned partition tokens can be used
* by [StreamingRead][google.spanner.v1.Spanner.StreamingRead] to specify a subset of the read
* result to read. The same session and read-only transaction must be used by
* the PartitionReadRequest used to create the partition tokens and the
* ReadRequests that use the partition tokens. There are no ordering
* guarantees on rows returned among the returned partition tokens, or even
* within each individual StreamingRead call issued with a partition_token.
* by [StreamingRead][google.spanner.v1.Spanner.StreamingRead] to specify a
* subset of the read result to read. The same session and read-only
* transaction must be used by the PartitionReadRequest used to create the
* partition tokens and the ReadRequests that use the partition tokens. There
* are no ordering guarantees on rows returned among the returned partition
* tokens, or even within each individual StreamingRead call issued with a
* partition_token.
*
* Partition tokens become invalid when the session used to create them
* is deleted, is idle for too long, begins a new transaction, or becomes too
Expand Down
11 changes: 6 additions & 5 deletions Spanner/samples/V1/SpannerClient/read.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,24 @@
/**
* Reads rows from the database using key lookups and scans, as a
* simple key/value style alternative to
* [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. This method cannot be used to
* return a result set larger than 10 MiB; if the read matches more
* [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. This method cannot be
* used to return a result set larger than 10 MiB; if the read matches more
* data than that, the read fails with a `FAILED_PRECONDITION`
* error.
*
* Reads inside read-write transactions might return `ABORTED`. If
* this occurs, the application should restart the transaction from
* the beginning. See [Transaction][google.spanner.v1.Transaction] for more details.
* the beginning. See [Transaction][google.spanner.v1.Transaction] for more
* details.
*
* Larger result sets can be yielded in streaming fashion by calling
* [StreamingRead][google.spanner.v1.Spanner.StreamingRead] instead.
*
* @param string $formattedSession The session in which the read should be performed. Please see
* {@see SpannerClient::sessionName()} for help formatting this field.
* @param string $table The name of the table in the database to be read.
* @param string $columnsElement The columns of [table][google.spanner.v1.ReadRequest.table] to be returned for each row matching
* this request.
* @param string $columnsElement The columns of [table][google.spanner.v1.ReadRequest.table] to be
* returned for each row matching this request.
*/
function read_sample(string $formattedSession, string $table, string $columnsElement): void
{
Expand Down
5 changes: 3 additions & 2 deletions Spanner/samples/V1/SpannerClient/rollback.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
/**
* Rolls back a transaction, releasing any locks it holds. It is a good
* idea to call this for any transaction that includes one or more
* [Read][google.spanner.v1.Spanner.Read] or [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] requests and
* ultimately decides not to commit.
* [Read][google.spanner.v1.Spanner.Read] or
* [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] requests and ultimately
* decides not to commit.
*
* `Rollback` returns `OK` if it successfully aborts the transaction, the
* transaction was already aborted, or the transaction is not
Expand Down
10 changes: 5 additions & 5 deletions Spanner/samples/V1/SpannerClient/streaming_read.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@
use Google\Cloud\Spanner\V1\SpannerClient;

/**
* Like [Read][google.spanner.v1.Spanner.Read], except returns the result set as a
* stream. Unlike [Read][google.spanner.v1.Spanner.Read], there is no limit on the
* size of the returned result set. However, no individual row in
* Like [Read][google.spanner.v1.Spanner.Read], except returns the result set
* as a stream. Unlike [Read][google.spanner.v1.Spanner.Read], there is no
* limit on the size of the returned result set. However, no individual row in
* the result set can exceed 100 MiB, and no column value can exceed
* 10 MiB.
*
* @param string $formattedSession The session in which the read should be performed. Please see
* {@see SpannerClient::sessionName()} for help formatting this field.
* @param string $table The name of the table in the database to be read.
* @param string $columnsElement The columns of [table][google.spanner.v1.ReadRequest.table] to be returned for each row matching
* this request.
* @param string $columnsElement The columns of [table][google.spanner.v1.ReadRequest.table] to be
* returned for each row matching this request.
*/
function streaming_read_sample(
string $formattedSession,
Expand Down
18 changes: 12 additions & 6 deletions Spanner/src/V1/BatchCreateSessionsRequest.php

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

3 changes: 2 additions & 1 deletion Spanner/src/V1/BatchCreateSessionsResponse.php

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

3 changes: 2 additions & 1 deletion Spanner/src/V1/BeginTransactionRequest.php

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

Loading

0 comments on commit 6b5bb82

Please sign in to comment.