@google-cloud/spanner 8.1.0 → 8.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -80,7 +80,25 @@ console.log(`Query: ${rows.length} found.`);
80
80
  rows.forEach(row => console.log(row));
81
81
 
82
82
  ```
83
+ ## Multiplexed Sessions
83
84
 
85
+ Spanner's Multiplexed Sessions can now be used as an efficient alternative to the default session pool. This feature helps reduce
86
+ session management overhead and minimize session-related errors. Multiplexed sessions can be enabled for all transaction types via environment variables.
87
+
88
+ ### Configuration
89
+
90
+ To enable this feature, set the following environment variables to `true`:
91
+
92
+ * **For Read-Only Transactions:**
93
+ - `GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS`
94
+ * **For Partitioned Operations:**
95
+ - `GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS`
96
+ - `GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS_PARTITIONED_OPS`
97
+ * **For Read-Write Transactions:**
98
+ - `GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS`
99
+ - `GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS_FOR_RW`
100
+
101
+ For a detailed explanation of this feature, please refer to the [official documentation](https://cloud.google.com/spanner/docs/sessions#multiplexed_sessions).
84
102
 
85
103
 
86
104
  ## Samples
@@ -152,8 +152,8 @@ message KeySet {
152
152
  // encoded as described [here][google.spanner.v1.TypeCode].
153
153
  repeated google.protobuf.ListValue keys = 1;
154
154
 
155
- // A list of key ranges. See [KeyRange][google.spanner.v1.KeyRange] for more information about
156
- // key range specifications.
155
+ // A list of key ranges. See [KeyRange][google.spanner.v1.KeyRange] for more
156
+ // information about key range specifications.
157
157
  repeated KeyRange ranges = 2;
158
158
 
159
159
  // For convenience `all` can be set to `true` to indicate that this
@@ -32,13 +32,16 @@ option ruby_package = "Google::Cloud::Spanner::V1";
32
32
  // applied to a Cloud Spanner database by sending them in a
33
33
  // [Commit][google.spanner.v1.Spanner.Commit] call.
34
34
  message Mutation {
35
- // Arguments to [insert][google.spanner.v1.Mutation.insert], [update][google.spanner.v1.Mutation.update], [insert_or_update][google.spanner.v1.Mutation.insert_or_update], and
35
+ // Arguments to [insert][google.spanner.v1.Mutation.insert],
36
+ // [update][google.spanner.v1.Mutation.update],
37
+ // [insert_or_update][google.spanner.v1.Mutation.insert_or_update], and
36
38
  // [replace][google.spanner.v1.Mutation.replace] operations.
37
39
  message Write {
38
40
  // Required. The table whose rows will be written.
39
41
  string table = 1 [(google.api.field_behavior) = REQUIRED];
40
42
 
41
- // The names of the columns in [table][google.spanner.v1.Mutation.Write.table] to be written.
43
+ // The names of the columns in
44
+ // [table][google.spanner.v1.Mutation.Write.table] to be written.
42
45
  //
43
46
  // The list of columns must contain enough columns to allow
44
47
  // Cloud Spanner to derive values for all primary key columns in the
@@ -48,11 +51,13 @@ message Mutation {
48
51
  // The values to be written. `values` can contain more than one
49
52
  // list of values. If it does, then multiple rows are written, one
50
53
  // for each entry in `values`. Each list in `values` must have
51
- // exactly as many entries as there are entries in [columns][google.spanner.v1.Mutation.Write.columns]
52
- // above. Sending multiple lists is equivalent to sending multiple
53
- // `Mutation`s, each containing one `values` entry and repeating
54
- // [table][google.spanner.v1.Mutation.Write.table] and [columns][google.spanner.v1.Mutation.Write.columns]. Individual values in each list are
55
- // encoded as described [here][google.spanner.v1.TypeCode].
54
+ // exactly as many entries as there are entries in
55
+ // [columns][google.spanner.v1.Mutation.Write.columns] above. Sending
56
+ // multiple lists is equivalent to sending multiple `Mutation`s, each
57
+ // containing one `values` entry and repeating
58
+ // [table][google.spanner.v1.Mutation.Write.table] and
59
+ // [columns][google.spanner.v1.Mutation.Write.columns]. Individual values in
60
+ // each list are encoded as described [here][google.spanner.v1.TypeCode].
56
61
  repeated google.protobuf.ListValue values = 3;
57
62
  }
58
63
 
@@ -61,12 +66,12 @@ message Mutation {
61
66
  // Required. The table whose rows will be deleted.
62
67
  string table = 1 [(google.api.field_behavior) = REQUIRED];
63
68
 
64
- // Required. The primary keys of the rows within [table][google.spanner.v1.Mutation.Delete.table] to delete. The
65
- // primary keys must be specified in the order in which they appear in the
66
- // `PRIMARY KEY()` clause of the table's equivalent DDL statement (the DDL
67
- // statement used to create the table).
68
- // Delete is idempotent. The transaction will succeed even if some or all
69
- // rows do not exist.
69
+ // Required. The primary keys of the rows within
70
+ // [table][google.spanner.v1.Mutation.Delete.table] to delete. The primary
71
+ // keys must be specified in the order in which they appear in the `PRIMARY
72
+ // KEY()` clause of the table's equivalent DDL statement (the DDL statement
73
+ // used to create the table). Delete is idempotent. The transaction will
74
+ // succeed even if some or all rows do not exist.
70
75
  KeySet key_set = 2 [(google.api.field_behavior) = REQUIRED];
71
76
  }
72
77
 
@@ -80,19 +85,22 @@ message Mutation {
80
85
  // already exist, the transaction fails with error `NOT_FOUND`.
81
86
  Write update = 2;
82
87
 
83
- // Like [insert][google.spanner.v1.Mutation.insert], except that if the row already exists, then
84
- // its column values are overwritten with the ones provided. Any
85
- // column values not explicitly written are preserved.
88
+ // Like [insert][google.spanner.v1.Mutation.insert], except that if the row
89
+ // already exists, then its column values are overwritten with the ones
90
+ // provided. Any column values not explicitly written are preserved.
86
91
  //
87
- // When using [insert_or_update][google.spanner.v1.Mutation.insert_or_update], just as when using [insert][google.spanner.v1.Mutation.insert], all `NOT
88
- // NULL` columns in the table must be given a value. This holds true
89
- // even when the row already exists and will therefore actually be updated.
92
+ // When using
93
+ // [insert_or_update][google.spanner.v1.Mutation.insert_or_update], just as
94
+ // when using [insert][google.spanner.v1.Mutation.insert], all `NOT NULL`
95
+ // columns in the table must be given a value. This holds true even when the
96
+ // row already exists and will therefore actually be updated.
90
97
  Write insert_or_update = 3;
91
98
 
92
- // Like [insert][google.spanner.v1.Mutation.insert], except that if the row already exists, it is
93
- // deleted, and the column values provided are inserted
94
- // instead. Unlike [insert_or_update][google.spanner.v1.Mutation.insert_or_update], this means any values not
95
- // explicitly written become `NULL`.
99
+ // Like [insert][google.spanner.v1.Mutation.insert], except that if the row
100
+ // already exists, it is deleted, and the column values provided are
101
+ // inserted instead. Unlike
102
+ // [insert_or_update][google.spanner.v1.Mutation.insert_or_update], this
103
+ // means any values not explicitly written become `NULL`.
96
104
  //
97
105
  // In an interleaved table, if you create the child table with the
98
106
  // `ON DELETE CASCADE` annotation, then replacing a parent row
@@ -26,10 +26,11 @@ option java_package = "com.google.spanner.v1";
26
26
  option php_namespace = "Google\\Cloud\\Spanner\\V1";
27
27
  option ruby_package = "Google::Cloud::Spanner::V1";
28
28
 
29
- // Node information for nodes appearing in a [QueryPlan.plan_nodes][google.spanner.v1.QueryPlan.plan_nodes].
29
+ // Node information for nodes appearing in a
30
+ // [QueryPlan.plan_nodes][google.spanner.v1.QueryPlan.plan_nodes].
30
31
  message PlanNode {
31
- // The kind of [PlanNode][google.spanner.v1.PlanNode]. Distinguishes between the two different kinds of
32
- // nodes that can appear in a query plan.
32
+ // The kind of [PlanNode][google.spanner.v1.PlanNode]. Distinguishes between
33
+ // the two different kinds of nodes that can appear in a query plan.
33
34
  enum Kind {
34
35
  // Not specified.
35
36
  KIND_UNSPECIFIED = 0;
@@ -58,14 +59,14 @@ message PlanNode {
58
59
  // with the output variable.
59
60
  string type = 2;
60
61
 
61
- // Only present if the child node is [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] and corresponds
62
- // to an output variable of the parent node. The field carries the name of
63
- // the output variable.
64
- // For example, a `TableScan` operator that reads rows from a table will
65
- // have child links to the `SCALAR` nodes representing the output variables
66
- // created for each column that is read by the operator. The corresponding
67
- // `variable` fields will be set to the variable names assigned to the
68
- // columns.
62
+ // Only present if the child node is
63
+ // [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] and corresponds to an
64
+ // output variable of the parent node. The field carries the name of the
65
+ // output variable. For example, a `TableScan` operator that reads rows from
66
+ // a table will have child links to the `SCALAR` nodes representing the
67
+ // output variables created for each column that is read by the operator.
68
+ // The corresponding `variable` fields will be set to the variable names
69
+ // assigned to the columns.
69
70
  string variable = 3;
70
71
  }
71
72
 
@@ -83,14 +84,15 @@ message PlanNode {
83
84
  map<string, int32> subqueries = 2;
84
85
  }
85
86
 
86
- // The `PlanNode`'s index in [node list][google.spanner.v1.QueryPlan.plan_nodes].
87
+ // The `PlanNode`'s index in [node
88
+ // list][google.spanner.v1.QueryPlan.plan_nodes].
87
89
  int32 index = 1;
88
90
 
89
91
  // Used to determine the type of node. May be needed for visualizing
90
92
  // different kinds of nodes differently. For example, If the node is a
91
- // [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] node, it will have a condensed representation
92
- // which can be used to directly embed a description of the node in its
93
- // parent.
93
+ // [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] node, it will have a
94
+ // condensed representation which can be used to directly embed a description
95
+ // of the node in its parent.
94
96
  Kind kind = 2;
95
97
 
96
98
  // The display name for the node.
@@ -99,7 +101,8 @@ message PlanNode {
99
101
  // List of child node `index`es and their relationship to this parent.
100
102
  repeated ChildLink child_links = 4;
101
103
 
102
- // Condensed representation for [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] nodes.
104
+ // Condensed representation for
105
+ // [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] nodes.
103
106
  ShortRepresentation short_representation = 5;
104
107
 
105
108
  // Attributes relevant to the node contained in a group of key-value pairs.
@@ -122,7 +125,7 @@ message PlanNode {
122
125
  // Contains an ordered list of nodes appearing in the query plan.
123
126
  message QueryPlan {
124
127
  // The nodes in the query plan. Plan nodes are returned in pre-order starting
125
- // with the plan root. Each [PlanNode][google.spanner.v1.PlanNode]'s `id` corresponds to its index in
126
- // `plan_nodes`.
128
+ // with the plan root. Each [PlanNode][google.spanner.v1.PlanNode]'s `id`
129
+ // corresponds to its index in `plan_nodes`.
127
130
  repeated PlanNode plan_nodes = 1;
128
131
  }