@google-cloud/spanner 5.15.1 → 5.16.2

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/CHANGELOG.md CHANGED
@@ -4,6 +4,40 @@
4
4
 
5
5
  [1]: https://www.npmjs.com/package/nodejs-spanner?activeTab=versions
6
6
 
7
+ ### [5.16.2](https://github.com/googleapis/nodejs-spanner/compare/v5.16.1...v5.16.2) (2022-01-17)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * fix for new @types/node version ([#1542](https://github.com/googleapis/nodejs-spanner/issues/1542)) ([4b56c58](https://github.com/googleapis/nodejs-spanner/commit/4b56c584fa85ab8b22867157566ce7245daa8d8d))
13
+
14
+ ### [5.16.1](https://www.github.com/googleapis/nodejs-spanner/compare/v5.16.0...v5.16.1) (2021-12-29)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * change in region ([#1523](https://www.github.com/googleapis/nodejs-spanner/issues/1523)) ([6caefc4](https://www.github.com/googleapis/nodejs-spanner/commit/6caefc4a0aafaa786a1d4b3fe3501d005d03bf6e))
20
+
21
+ ## [5.16.0](https://www.github.com/googleapis/nodejs-spanner/compare/v5.15.2...v5.16.0) (2021-12-09)
22
+
23
+
24
+ ### Features
25
+
26
+ * add eslintignore for sameple generated code ([#1302](https://www.github.com/googleapis/nodejs-spanner/issues/1302)) ([#1520](https://www.github.com/googleapis/nodejs-spanner/issues/1520)) ([f835b72](https://www.github.com/googleapis/nodejs-spanner/commit/f835b721210d01b11d7f5751ee06f13518e7fe0f))
27
+
28
+
29
+ ### Bug Fixes
30
+
31
+ * **build:** set default branch to main ([#1469](https://www.github.com/googleapis/nodejs-spanner/issues/1469)) ([152985a](https://www.github.com/googleapis/nodejs-spanner/commit/152985a1f783534e6b3e3ce332a1333dec67269d))
32
+ * **cloud-rad:** move comments for TSDoc ([#1509](https://www.github.com/googleapis/nodejs-spanner/issues/1509)) ([1c49922](https://www.github.com/googleapis/nodejs-spanner/commit/1c49922c75bd56dbd0456318bee8a336eb088156))
33
+
34
+ ### [5.15.2](https://www.github.com/googleapis/nodejs-spanner/compare/v5.15.1...v5.15.2) (2021-09-10)
35
+
36
+
37
+ ### Bug Fixes
38
+
39
+ * never try to create a negative number of sessions ([#1467](https://www.github.com/googleapis/nodejs-spanner/issues/1467)) ([13f5153](https://www.github.com/googleapis/nodejs-spanner/commit/13f51537ab13e0cd5a1fb9142f76796b1911809c))
40
+
7
41
  ### [5.15.1](https://www.github.com/googleapis/nodejs-spanner/compare/v5.15.0...v5.15.1) (2021-09-08)
8
42
 
9
43
 
package/README.md CHANGED
@@ -4,9 +4,8 @@
4
4
 
5
5
  # [Cloud Spanner: Node.js Client](https://github.com/googleapis/nodejs-spanner)
6
6
 
7
- [![release level](https://img.shields.io/badge/release%20level-general%20availability%20%28GA%29-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages)
7
+ [![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages)
8
8
  [![npm version](https://img.shields.io/npm/v/@google-cloud/spanner.svg)](https://www.npmjs.org/package/@google-cloud/spanner)
9
- [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-spanner/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-spanner)
10
9
 
11
10
 
12
11
 
@@ -17,7 +16,7 @@ and automatic, synchronous replication for high availability.
17
16
 
18
17
 
19
18
  A comprehensive list of changes in each version may be found in
20
- [the CHANGELOG](https://github.com/googleapis/nodejs-spanner/blob/master/CHANGELOG.md).
19
+ [the CHANGELOG](https://github.com/googleapis/nodejs-spanner/blob/main/CHANGELOG.md).
21
20
 
22
21
  * [Cloud Spanner Node.js Client API Reference][client-docs]
23
22
  * [Cloud Spanner Documentation][product-docs]
@@ -86,58 +85,58 @@ rows.forEach(row => console.log(row));
86
85
 
87
86
  ## Samples
88
87
 
89
- Samples are in the [`samples/`](https://github.com/googleapis/nodejs-spanner/tree/master/samples) directory. Each sample's `README.md` has instructions for running its sample.
88
+ Samples are in the [`samples/`](https://github.com/googleapis/nodejs-spanner/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample.
90
89
 
91
90
  | Sample | Source Code | Try it |
92
91
  | --------------------------- | --------------------------------- | ------ |
93
- | Backups-cancel | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/backups-cancel.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/backups-cancel.js,samples/README.md) |
94
- | Backups-create-with-encryption-key | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/backups-create-with-encryption-key.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/backups-create-with-encryption-key.js,samples/README.md) |
95
- | Backups-create | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/backups-create.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/backups-create.js,samples/README.md) |
96
- | Backups-delete | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/backups-delete.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/backups-delete.js,samples/README.md) |
97
- | Backups-get-database-operations | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/backups-get-database-operations.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/backups-get-database-operations.js,samples/README.md) |
98
- | Backups-get-operations | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/backups-get-operations.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/backups-get-operations.js,samples/README.md) |
99
- | Backups-get | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/backups-get.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/backups-get.js,samples/README.md) |
100
- | Backups-restore-with-encryption-key | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/backups-restore-with-encryption-key.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/backups-restore-with-encryption-key.js,samples/README.md) |
101
- | Backups-restore | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/backups-restore.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/backups-restore.js,samples/README.md) |
102
- | Backups-update | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/backups-update.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/backups-update.js,samples/README.md) |
103
- | Backups | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/backups.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/backups.js,samples/README.md) |
104
- | Batch | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/batch.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/batch.js,samples/README.md) |
105
- | CRUD | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/crud.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/crud.js,samples/README.md) |
106
- | Creates a new database with a specific default leader | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/database-create-with-default-leader.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/database-create-with-default-leader.js,samples/README.md) |
107
- | Database-create-with-encryption-key | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/database-create-with-encryption-key.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/database-create-with-encryption-key.js,samples/README.md) |
108
- | Database-create-with-version-retention-period | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/database-create-with-version-retention-period.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/database-create-with-version-retention-period.js,samples/README.md) |
109
- | Gets the schema definition of an existing database | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/database-get-ddl.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/database-get-ddl.js,samples/README.md) |
110
- | Gets the default leader option of an existing database | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/database-get-default-leader.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/database-get-default-leader.js,samples/README.md) |
111
- | Updates the default leader of an existing database | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/database-update-default-leader.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/database-update-default-leader.js,samples/README.md) |
112
- | Datatypes | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/datatypes.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/datatypes.js,samples/README.md) |
113
- | DML | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/dml.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/dml.js,samples/README.md) |
114
- | Get-commit-stats | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/get-commit-stats.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/get-commit-stats.js,samples/README.md) |
115
- | Gets the instance config metadata for the configuration nam6 | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/get-instance-config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/get-instance-config.js,samples/README.md) |
116
- | Creates a new value-storing index | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/index-create-storing.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/index-create-storing.js,samples/README.md) |
117
- | Creates a new index | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/index-create.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/index-create.js,samples/README.md) |
118
- | Executes a read-only SQL query using an existing index. | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/index-query-data.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/index-query-data.js,samples/README.md) |
119
- | Reads data using an existing storing index. | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/index-read-data-with-storing.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/index-read-data-with-storing.js,samples/README.md) |
120
- | Read data using an existing index. | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/index-read-data.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/index-read-data.js,samples/README.md) |
121
- | Indexing | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/indexing.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/indexing.js,samples/README.md) |
122
- | Instance-with-processing-units | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/instance-with-processing-units.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/instance-with-processing-units.js,samples/README.md) |
123
- | Instance | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/instance.js,samples/README.md) |
124
- | Json-add-column | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/json-add-column.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/json-add-column.js,samples/README.md) |
125
- | Json-query-parameter | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/json-query-parameter.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/json-query-parameter.js,samples/README.md) |
126
- | Json-update-data | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/json-update-data.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/json-update-data.js,samples/README.md) |
127
- | Lists all databases on the selected instance | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/list-databases.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/list-databases.js,samples/README.md) |
128
- | Lists all the available instance configs for the selected project. | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/list-instance-configs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/list-instance-configs.js,samples/README.md) |
129
- | Numeric-add-column | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/numeric-add-column.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/numeric-add-column.js,samples/README.md) |
130
- | Numeric-query-parameter | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/numeric-query-parameter.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/numeric-query-parameter.js,samples/README.md) |
131
- | Numeric-update-data | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/numeric-update-data.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/numeric-update-data.js,samples/README.md) |
132
- | Queryoptions | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/queryoptions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/queryoptions.js,samples/README.md) |
133
- | Quickstart | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) |
134
- | Sets a request tag for a single query | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/request-tag.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/request-tag.js,samples/README.md) |
135
- | Rpc-priority | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/rpc-priority.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/rpc-priority.js,samples/README.md) |
136
- | Schema | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/schema.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/schema.js,samples/README.md) |
137
- | Struct | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/struct.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/struct.js,samples/README.md) |
138
- | Timestamp | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/timestamp.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/timestamp.js,samples/README.md) |
139
- | Executes a read/write transaction with transaction and request tags | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/transaction-tag.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/transaction-tag.js,samples/README.md) |
140
- | Transaction | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/transaction.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/transaction.js,samples/README.md) |
92
+ | Backups-cancel | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/backups-cancel.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/backups-cancel.js,samples/README.md) |
93
+ | Backups-create-with-encryption-key | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/backups-create-with-encryption-key.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/backups-create-with-encryption-key.js,samples/README.md) |
94
+ | Backups-create | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/backups-create.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/backups-create.js,samples/README.md) |
95
+ | Backups-delete | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/backups-delete.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/backups-delete.js,samples/README.md) |
96
+ | Backups-get-database-operations | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/backups-get-database-operations.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/backups-get-database-operations.js,samples/README.md) |
97
+ | Backups-get-operations | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/backups-get-operations.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/backups-get-operations.js,samples/README.md) |
98
+ | Backups-get | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/backups-get.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/backups-get.js,samples/README.md) |
99
+ | Backups-restore-with-encryption-key | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/backups-restore-with-encryption-key.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/backups-restore-with-encryption-key.js,samples/README.md) |
100
+ | Backups-restore | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/backups-restore.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/backups-restore.js,samples/README.md) |
101
+ | Backups-update | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/backups-update.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/backups-update.js,samples/README.md) |
102
+ | Backups | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/backups.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/backups.js,samples/README.md) |
103
+ | Batch | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/batch.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/batch.js,samples/README.md) |
104
+ | CRUD | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/crud.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/crud.js,samples/README.md) |
105
+ | Creates a new database with a specific default leader | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/database-create-with-default-leader.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/database-create-with-default-leader.js,samples/README.md) |
106
+ | Database-create-with-encryption-key | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/database-create-with-encryption-key.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/database-create-with-encryption-key.js,samples/README.md) |
107
+ | Database-create-with-version-retention-period | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/database-create-with-version-retention-period.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/database-create-with-version-retention-period.js,samples/README.md) |
108
+ | Gets the schema definition of an existing database | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/database-get-ddl.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/database-get-ddl.js,samples/README.md) |
109
+ | Gets the default leader option of an existing database | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/database-get-default-leader.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/database-get-default-leader.js,samples/README.md) |
110
+ | Updates the default leader of an existing database | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/database-update-default-leader.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/database-update-default-leader.js,samples/README.md) |
111
+ | Datatypes | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/datatypes.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/datatypes.js,samples/README.md) |
112
+ | DML | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/dml.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/dml.js,samples/README.md) |
113
+ | Get-commit-stats | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/get-commit-stats.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/get-commit-stats.js,samples/README.md) |
114
+ | Gets the instance config metadata for the configuration nam6 | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/get-instance-config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/get-instance-config.js,samples/README.md) |
115
+ | Creates a new value-storing index | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/index-create-storing.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/index-create-storing.js,samples/README.md) |
116
+ | Creates a new index | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/index-create.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/index-create.js,samples/README.md) |
117
+ | Executes a read-only SQL query using an existing index. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/index-query-data.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/index-query-data.js,samples/README.md) |
118
+ | Reads data using an existing storing index. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/index-read-data-with-storing.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/index-read-data-with-storing.js,samples/README.md) |
119
+ | Read data using an existing index. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/index-read-data.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/index-read-data.js,samples/README.md) |
120
+ | Indexing | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/indexing.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/indexing.js,samples/README.md) |
121
+ | Instance-with-processing-units | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/instance-with-processing-units.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/instance-with-processing-units.js,samples/README.md) |
122
+ | Instance | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/instance.js,samples/README.md) |
123
+ | Json-add-column | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/json-add-column.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/json-add-column.js,samples/README.md) |
124
+ | Json-query-parameter | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/json-query-parameter.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/json-query-parameter.js,samples/README.md) |
125
+ | Json-update-data | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/json-update-data.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/json-update-data.js,samples/README.md) |
126
+ | Lists all databases on the selected instance | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/list-databases.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/list-databases.js,samples/README.md) |
127
+ | Lists all the available instance configs for the selected project. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/list-instance-configs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/list-instance-configs.js,samples/README.md) |
128
+ | Numeric-add-column | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/numeric-add-column.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/numeric-add-column.js,samples/README.md) |
129
+ | Numeric-query-parameter | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/numeric-query-parameter.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/numeric-query-parameter.js,samples/README.md) |
130
+ | Numeric-update-data | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/numeric-update-data.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/numeric-update-data.js,samples/README.md) |
131
+ | Queryoptions | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/queryoptions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/queryoptions.js,samples/README.md) |
132
+ | Quickstart | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) |
133
+ | Sets a request tag for a single query | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/request-tag.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/request-tag.js,samples/README.md) |
134
+ | Rpc-priority | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/rpc-priority.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/rpc-priority.js,samples/README.md) |
135
+ | Schema | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/schema.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/schema.js,samples/README.md) |
136
+ | Struct | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/struct.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/struct.js,samples/README.md) |
137
+ | Timestamp | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/timestamp.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/timestamp.js,samples/README.md) |
138
+ | Executes a read/write transaction with transaction and request tags | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/transaction-tag.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/transaction-tag.js,samples/README.md) |
139
+ | Transaction | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/transaction.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/transaction.js,samples/README.md) |
141
140
 
142
141
 
143
142
 
@@ -170,23 +169,24 @@ _Legacy Node.js versions are supported as a best effort:_
170
169
  This library follows [Semantic Versioning](http://semver.org/).
171
170
 
172
171
 
173
- This library is considered to be **General Availability (GA)**. This means it
174
- is stable; the code surface will not change in backwards-incompatible ways
172
+
173
+ This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways
175
174
  unless absolutely necessary (e.g. because of critical security issues) or with
176
- an extensive deprecation period. Issues and requests against **GA** libraries
175
+ an extensive deprecation period. Issues and requests against **stable** libraries
177
176
  are addressed with the highest priority.
178
177
 
179
178
 
180
179
 
181
180
 
182
181
 
182
+
183
183
  More Information: [Google Cloud Platform Launch Stages][launch_stages]
184
184
 
185
185
  [launch_stages]: https://cloud.google.com/terms/launch-stages
186
186
 
187
187
  ## Contributing
188
188
 
189
- Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-spanner/blob/master/CONTRIBUTING.md).
189
+ Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-spanner/blob/main/CONTRIBUTING.md).
190
190
 
191
191
  Please note that this `README.md`, the `samples/README.md`,
192
192
  and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`)
@@ -198,7 +198,7 @@ to its templates in
198
198
 
199
199
  Apache Version 2.0
200
200
 
201
- See [LICENSE](https://github.com/googleapis/nodejs-spanner/blob/master/LICENSE)
201
+ See [LICENSE](https://github.com/googleapis/nodejs-spanner/blob/main/LICENSE)
202
202
 
203
203
  [client-docs]: https://cloud.google.com/nodejs/docs/reference/spanner/latest
204
204
  [product-docs]: https://cloud.google.com/spanner/docs/
@@ -1,4 +1,4 @@
1
- // Copyright 2021 Google LLC
1
+ // Copyright 2022 Google LLC
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -16192,7 +16192,8 @@ export namespace google {
16192
16192
  OUTPUT_ONLY = 3,
16193
16193
  INPUT_ONLY = 4,
16194
16194
  IMMUTABLE = 5,
16195
- UNORDERED_LIST = 6
16195
+ UNORDERED_LIST = 6,
16196
+ NON_EMPTY_DEFAULT = 7
16196
16197
  }
16197
16198
 
16198
16199
  /** Properties of a ResourceDescriptor. */
@@ -1,4 +1,4 @@
1
- // Copyright 2021 Google LLC
1
+ // Copyright 2022 Google LLC
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -5790,6 +5790,7 @@
5790
5790
  case 4:
5791
5791
  case 5:
5792
5792
  case 6:
5793
+ case 7:
5793
5794
  break;
5794
5795
  }
5795
5796
  }
@@ -5894,6 +5895,10 @@
5894
5895
  case 6:
5895
5896
  message[".google.api.fieldBehavior"][i] = 6;
5896
5897
  break;
5898
+ case "NON_EMPTY_DEFAULT":
5899
+ case 7:
5900
+ message[".google.api.fieldBehavior"][i] = 7;
5901
+ break;
5897
5902
  }
5898
5903
  }
5899
5904
  if (object[".google.api.resourceReference"] != null) {
@@ -39954,6 +39959,7 @@
39954
39959
  * @property {number} INPUT_ONLY=4 INPUT_ONLY value
39955
39960
  * @property {number} IMMUTABLE=5 IMMUTABLE value
39956
39961
  * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value
39962
+ * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value
39957
39963
  */
39958
39964
  api.FieldBehavior = (function() {
39959
39965
  var valuesById = {}, values = Object.create(valuesById);
@@ -39964,6 +39970,7 @@
39964
39970
  values[valuesById[4] = "INPUT_ONLY"] = 4;
39965
39971
  values[valuesById[5] = "IMMUTABLE"] = 5;
39966
39972
  values[valuesById[6] = "UNORDERED_LIST"] = 6;
39973
+ values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7;
39967
39974
  return values;
39968
39975
  })();
39969
39976
 
@@ -575,6 +575,18 @@
575
575
  ]
576
576
  ],
577
577
  "reserved": [
578
+ [
579
+ 4,
580
+ 4
581
+ ],
582
+ [
583
+ 5,
584
+ 5
585
+ ],
586
+ [
587
+ 6,
588
+ 6
589
+ ],
578
590
  [
579
591
  8,
580
592
  8
@@ -4327,7 +4339,8 @@
4327
4339
  "OUTPUT_ONLY": 3,
4328
4340
  "INPUT_ONLY": 4,
4329
4341
  "IMMUTABLE": 5,
4330
- "UNORDERED_LIST": 6
4342
+ "UNORDERED_LIST": 6,
4343
+ "NON_EMPTY_DEFAULT": 7
4331
4344
  }
4332
4345
  },
4333
4346
  "resourceReference": {
@@ -54,10 +54,12 @@ export declare type ExistsCallback = NormalCallback<boolean>;
54
54
  * @class
55
55
  *
56
56
  * @example
57
+ * ```
57
58
  * const {Spanner} = require('@google-cloud/spanner');
58
59
  * const spanner = new Spanner();
59
60
  * const instance = spanner.instance('my-instance');
60
61
  * const backup = instance.backup('my-backup');
62
+ * ```
61
63
  */
62
64
  declare class Backup {
63
65
  id: string;
@@ -69,21 +71,231 @@ declare class Backup {
69
71
  request: BackupRequest;
70
72
  metadata?: databaseAdmin.spanner.admin.database.v1.IBackup;
71
73
  constructor(instance: Instance, name: string);
74
+ /**
75
+ * @typedef {object} CreateBackupOptions
76
+ * @property {string} databasePath The database path.
77
+ * @property {string|number|google.protobuf.Timestamp|external:PreciseDate}
78
+ * expireTime The expire time of the backup.
79
+ * @property {string|number|google.protobuf.Timestamp|external:PreciseDate}
80
+ * versionTime Take a backup of the state of the database at this time.
81
+ * @property {google.spanner.admin.database.v1.ICreateBackupEncryptionConfig}
82
+ * encryptionConfig An encryption configuration describing the
83
+ * encryption type and key resources in Cloud KMS to be used to encrypt
84
+ * the backup.
85
+ * @property {object} [gaxOptions] The request configuration options,
86
+ * See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions}
87
+ * for more details.
88
+ */
89
+ /**
90
+ * @typedef {array} CreateBackupResponse
91
+ * @property {Backup} 0 The new {@link Backup}.
92
+ * @property {google.longrunning.Operation} 1 An {@link Operation} object that can be used to check
93
+ * the status of the request.
94
+ * @property {object} 2 The full API response.
95
+ */
96
+ /**
97
+ * @callback CreateBackupCallback
98
+ * @param {?Error} err Request error, if any.
99
+ * @param {Backup} backup The new {@link Backup}.
100
+ * @param {google.longrunning.Operation} operation An {@link Operation} object that can be used to
101
+ * check the status of the request.
102
+ * @param {object} apiResponse The full API response.
103
+ */
104
+ /**
105
+ * Create a backup.
106
+ *
107
+ * @method Backup#create
108
+ * @param {CreateBackupOptions} options Parameters for creating a backup.
109
+ * @param {CallOptions} [options.gaxOptions] The request configuration
110
+ * options, See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions}
111
+ * for more details.
112
+ * @param {CreateBackupCallback} [callback] Callback function.
113
+ * @returns {Promise<CreateBackupResponse>} When resolved, the backup
114
+ * operation will have started, but will not have necessarily completed.
115
+ *
116
+ * @example
117
+ * ```
118
+ * const {Spanner} = require('@google-cloud/spanner');
119
+ * const spanner = new Spanner();
120
+ * const instance = spanner.instance('my-instance');
121
+ * const oneDay = 1000 * 60 * 60 * 24;
122
+ * const expireTime = Date.now() + oneDay;
123
+ * const versionTime = Date.now() - oneDay;
124
+ * const backup = instance.backup('my-backup');
125
+ * const [, backupOperation] = await backup.create({
126
+ * databasePath: 'projects/my-project/instances/my-instance/databases/my-database',
127
+ * expireTime: expireTime,
128
+ * versionTime: versionTime,
129
+ * encryptionConfig: {
130
+ * encryptionType: 'CUSTOMER_MANAGED_ENCRYPTION',
131
+ * kmsKeyName: 'projects/my-project-id/my-region/keyRings/my-key-ring/cryptoKeys/my-key',
132
+ * },
133
+ * });
134
+ * // Await completion of the backup operation.
135
+ * await backupOperation.promise();
136
+ * ```
137
+ */
72
138
  create(options: CreateBackupOptions): Promise<CreateBackupResponse>;
73
139
  create(options: CreateBackupOptions, callback: CreateBackupCallback): void;
140
+ /**
141
+ * @typedef {array} GetMetadataResponse
142
+ * @property {object} 0 The {@link Backup} metadata.
143
+ * @property {object} 1 The full API response.
144
+ */
145
+ /**
146
+ * @callback GetMetadataCallback
147
+ * @param {?Error} err Request error, if any.
148
+ * @param {object} metadata The {@link Backup} metadata.
149
+ * @param {object} apiResponse The full API response.
150
+ */
151
+ /**
152
+ * Retrieves backup's metadata.
153
+ *
154
+ * @see {@link #getState}
155
+ * @see {@link #getExpireTime}
156
+ *
157
+ * @method Backup#getMetadata
158
+ * @param {object} [gaxOptions] Request configuration options,
159
+ * See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions}
160
+ * for more details.
161
+ * @param {GetMetadataCallback} [callback] Callback function.
162
+ * @returns {Promise<GetMetadataResponse>}
163
+ *
164
+ * @example
165
+ * ```
166
+ * const {Spanner} = require('@google-cloud/spanner');
167
+ * const spanner = new Spanner();
168
+ * const instance = spanner.instance('my-instance');
169
+ * const backup = instance.backup('my-backup');
170
+ * const [backupInfo] = await backup.getMetadata();
171
+ * console.log(`${backupInfo.name}: size=${backupInfo.sizeBytes}`);
172
+ * ```
173
+ */
74
174
  getMetadata(gaxOptions?: CallOptions): Promise<GetMetadataResponse>;
75
175
  getMetadata(callback: GetMetadataCallback): void;
76
176
  getMetadata(gaxOptions: CallOptions, callback: GetMetadataCallback): void;
177
+ /**
178
+ * Retrieves the state of the backup.
179
+ *
180
+ * The backup state indicates if the backup has completed.
181
+ *
182
+ * @see {@link #getMetadata}
183
+ *
184
+ * @method Backup#getState
185
+ * @param {GetStateCallback} [callback] Callback function.
186
+ * @returns {Promise<EnumKey<typeof, databaseAdmin.spanner.admin.database.v1.Backup.State> | undefined>}
187
+ * When resolved, contains the current state of the backup if it exists.
188
+ *
189
+ * @example
190
+ * ```
191
+ * const {Spanner} = require('@google-cloud/spanner');
192
+ * const spanner = new Spanner();
193
+ * const instance = spanner.instance('my-instance');
194
+ * const backup = instance.backup('my-backup');
195
+ * const state = await backup.getState();
196
+ * const backupCompleted = (state === 'READY');
197
+ * ```
198
+ */
77
199
  getState(): Promise<EnumKey<typeof databaseAdmin.spanner.admin.database.v1.Backup.State> | undefined | null>;
78
200
  getState(callback: GetStateCallback): void;
201
+ /**
202
+ * Retrieves the expiry time of the backup.
203
+ *
204
+ * @see {@link #updateExpireTime}
205
+ * @see {@link #getMetadata}
206
+ *
207
+ * @method Backup#getExpireTime
208
+ * @returns {Promise<external:PreciseDate>} When resolved, contains the
209
+ * current expire time of the backup if it exists.
210
+ *
211
+ * @example
212
+ * ```
213
+ * const {Spanner} = require('@google-cloud/spanner');
214
+ * const spanner = new Spanner();
215
+ * const instance = spanner.instance('my-instance');
216
+ * const backup = instance.backup('my-backup');
217
+ * const expireTime = await backup.getExpireTime();
218
+ * console.log(`Backup expires on ${expireTime.toISOString()}`);
219
+ * ```
220
+ */
79
221
  getExpireTime(): Promise<PreciseDate | undefined>;
80
222
  getExpireTime(callback: GetExpireTimeCallback): void;
223
+ /**
224
+ * Checks whether the backup exists.
225
+ *
226
+ * @see {@link #getMetadata}
227
+ *
228
+ * @method Backup#exists
229
+ * @returns {Promise<boolean>} When resolved, contains true if the backup
230
+ * exists and false if it does not exist.
231
+ *
232
+ * @example
233
+ * ```
234
+ * const {Spanner} = require('@google-cloud/spanner');
235
+ * const spanner = new Spanner();
236
+ * const instance = spanner.instance('my-instance');
237
+ * const backup = instance.backup('my-backup');
238
+ * const alreadyExists = await backup.exists();
239
+ * console.log(`Does backup exist? ${alreadyExists}`);
240
+ * ```
241
+ */
81
242
  exists(): Promise<boolean>;
82
243
  exists(callback: ExistsCallback): void;
244
+ /**
245
+ * @callback UpdateExpireTimeCallback
246
+ * @param {?Error} err Request error, if any.
247
+ * @param {google.spanner.admin.database.v1.IBackup} backup The updated
248
+ * backup.
249
+ */
250
+ /**
251
+ * Sets the expiry time of a backup.
252
+ *
253
+ * @see {@link #getExpireTime}
254
+ *
255
+ * @method Backup#updateExpireTime
256
+ * @param {string|number|google.protobuf.Timestamp|external:PreciseDate}
257
+ * expireTime The expiry time to update with.
258
+ * @param {object} [gaxOptions] Request configuration options,
259
+ * See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions}
260
+ * for more details.
261
+ * @param {UpdateExpireTimeCallback} [callback] Callback function.
262
+ * @returns {Promise<google.spanner.admin.database.v1.IBackup>} When resolved,
263
+ * the backup's expire time will have been updated.
264
+ *
265
+ * @example
266
+ * ```
267
+ * const {Spanner} = require('@google-cloud/spanner');
268
+ * const spanner = new Spanner();
269
+ * const instance = spanner.instance('my-instance');
270
+ * const backup = instance.backup('my-backup');
271
+ * const oneDay = 1000 * 60 * 60 * 24;
272
+ * const newExpireTime = Spanner.timestamp(Date.now() + oneDay);
273
+ * await backup.updateExpireTime(newExpireTime);
274
+ * ```
275
+ */
83
276
  updateExpireTime(expireTime: string | number | p.ITimestamp | PreciseDate): Promise<databaseAdmin.spanner.admin.database.v1.IBackup>;
84
277
  updateExpireTime(expireTime: string | number | p.ITimestamp | PreciseDate, gaxOptions?: CallOptions): Promise<databaseAdmin.spanner.admin.database.v1.IBackup>;
85
278
  updateExpireTime(expireTime: string | number | p.ITimestamp | PreciseDate, callback: UpdateExpireTimeCallback): void;
86
279
  updateExpireTime(expireTime: string | number | p.ITimestamp | PreciseDate, gaxOptions: CallOptions, callback: UpdateExpireTimeCallback): void;
280
+ /**
281
+ * Deletes a backup.
282
+ *
283
+ * @method Backup#delete
284
+ * @param {object} [gaxOptions] Request configuration options,
285
+ * See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions}
286
+ * for more details.
287
+ * @param {DeleteBackupCallback} [callback] Callback function.
288
+ * @returns {Promise<void>} When resolved, the backup will have been deleted.
289
+ *
290
+ * @example
291
+ * ```
292
+ * const {Spanner} = require('@google-cloud/spanner');
293
+ * const spanner = new Spanner();
294
+ * const instance = spanner.instance('my-instance');
295
+ * const backup = instance.backup('my-backup');
296
+ * await backup.delete();
297
+ * ```
298
+ */
87
299
  delete(gaxOptions?: CallOptions): Promise<databaseAdmin.protobuf.IEmpty>;
88
300
  delete(callback: DeleteCallback): void;
89
301
  delete(gaxOptions: CallOptions, callback: DeleteCallback): void;
@@ -97,11 +309,13 @@ declare class Backup {
97
309
  * @returns {string}
98
310
  *
99
311
  * @example
312
+ * ```
100
313
  * Backup.formatName_(
101
314
  * 'projects/grape-spaceship-123/instances/my-instance',
102
315
  * 'my-backup'
103
316
  * );
104
317
  * // 'projects/grape-spaceship-123/instances/my-instance/backups/my-backup'
318
+ * ```
105
319
  */
106
320
  static formatName_(instanceName: string, name: string): string;
107
321
  }