@google-cloud/spanner 5.15.0 → 5.16.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/CHANGELOG.md +34 -0
- package/README.md +55 -53
- package/build/protos/protos.d.ts +2 -1
- package/build/protos/protos.js +7 -0
- package/build/protos/protos.json +14 -1
- package/build/src/backup.d.ts +214 -0
- package/build/src/backup.js +4 -196
- package/build/src/batch-transaction.d.ts +6 -0
- package/build/src/batch-transaction.js +6 -0
- package/build/src/codec.d.ts +4 -0
- package/build/src/codec.js +4 -0
- package/build/src/database.d.ts +1244 -22
- package/build/src/database.js +36 -1184
- package/build/src/index.d.ts +366 -17
- package/build/src/index.js +39 -312
- package/build/src/instance.d.ts +526 -0
- package/build/src/instance.js +18 -498
- package/build/src/session-pool.d.ts +5 -5
- package/build/src/session-pool.js +13 -8
- package/build/src/session.d.ts +98 -0
- package/build/src/session.js +16 -82
- package/build/src/table.d.ts +645 -0
- package/build/src/table.js +4 -623
- package/build/src/transaction.d.ts +509 -19
- package/build/src/transaction.js +60 -443
- package/build/src/v1/database_admin_client.d.ts +666 -40
- package/build/src/v1/database_admin_client.js +32 -706
- package/build/src/v1/gapic_metadata.json +1 -1
- package/build/src/v1/instance_admin_client.d.ts +357 -20
- package/build/src/v1/instance_admin_client.js +16 -377
- package/build/src/v1/spanner_client.d.ts +586 -13
- package/build/src/v1/spanner_client.js +10 -596
- package/package.json +3 -3
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.1](https://www.github.com/googleapis/nodejs-spanner/compare/v5.16.0...v5.16.1) (2021-12-29)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* change in region ([#1523](https://www.github.com/googleapis/nodejs-spanner/issues/1523)) ([6caefc4](https://www.github.com/googleapis/nodejs-spanner/commit/6caefc4a0aafaa786a1d4b3fe3501d005d03bf6e))
|
|
13
|
+
|
|
14
|
+
## [5.16.0](https://www.github.com/googleapis/nodejs-spanner/compare/v5.15.2...v5.16.0) (2021-12-09)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* 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))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* **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))
|
|
25
|
+
* **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))
|
|
26
|
+
|
|
27
|
+
### [5.15.2](https://www.github.com/googleapis/nodejs-spanner/compare/v5.15.1...v5.15.2) (2021-09-10)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Bug Fixes
|
|
31
|
+
|
|
32
|
+
* 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))
|
|
33
|
+
|
|
34
|
+
### [5.15.1](https://www.github.com/googleapis/nodejs-spanner/compare/v5.15.0...v5.15.1) (2021-09-08)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### Bug Fixes
|
|
38
|
+
|
|
39
|
+
* **deps:** google-gax v2.17.1 ([#1429](https://www.github.com/googleapis/nodejs-spanner/issues/1429)) ([3a1517c](https://www.github.com/googleapis/nodejs-spanner/commit/3a1517cff95bd00598935b30859c7991b4d4c4ca))
|
|
40
|
+
|
|
7
41
|
## [5.15.0](https://www.github.com/googleapis/nodejs-spanner/compare/v5.14.0...v5.15.0) (2021-08-26)
|
|
8
42
|
|
|
9
43
|
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
[](https://cloud.google.com/terms/launch-stages)
|
|
8
8
|
[](https://www.npmjs.org/package/@google-cloud/spanner)
|
|
9
|
-
[](https://codecov.io/gh/googleapis/nodejs-spanner)
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
@@ -17,7 +17,7 @@ and automatic, synchronous replication for high availability.
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
A comprehensive list of changes in each version may be found in
|
|
20
|
-
[the CHANGELOG](https://github.com/googleapis/nodejs-spanner/blob/
|
|
20
|
+
[the CHANGELOG](https://github.com/googleapis/nodejs-spanner/blob/main/CHANGELOG.md).
|
|
21
21
|
|
|
22
22
|
* [Cloud Spanner Node.js Client API Reference][client-docs]
|
|
23
23
|
* [Cloud Spanner Documentation][product-docs]
|
|
@@ -86,58 +86,58 @@ rows.forEach(row => console.log(row));
|
|
|
86
86
|
|
|
87
87
|
## Samples
|
|
88
88
|
|
|
89
|
-
Samples are in the [`samples/`](https://github.com/googleapis/nodejs-spanner/tree/
|
|
89
|
+
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
90
|
|
|
91
91
|
| Sample | Source Code | Try it |
|
|
92
92
|
| --------------------------- | --------------------------------- | ------ |
|
|
93
|
-
| Backups-cancel | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
94
|
-
| Backups-create-with-encryption-key | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
95
|
-
| Backups-create | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
96
|
-
| Backups-delete | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
97
|
-
| Backups-get-database-operations | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
98
|
-
| Backups-get-operations | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
99
|
-
| Backups-get | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
100
|
-
| Backups-restore-with-encryption-key | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
101
|
-
| Backups-restore | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
102
|
-
| Backups-update | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
103
|
-
| Backups | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
104
|
-
| Batch | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
105
|
-
| CRUD | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
106
|
-
| Creates a new database with a specific default leader | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
107
|
-
| Database-create-with-encryption-key | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
108
|
-
| Database-create-with-version-retention-period | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
109
|
-
| Gets the schema definition of an existing database | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
110
|
-
| Gets the default leader option of an existing database | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
111
|
-
| Updates the default leader of an existing database | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
112
|
-
| Datatypes | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
113
|
-
| DML | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
114
|
-
| Get-commit-stats | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
115
|
-
| Gets the instance config metadata for the configuration nam6 | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
116
|
-
| Creates a new value-storing index | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
117
|
-
| Creates a new index | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
118
|
-
| Executes a read-only SQL query using an existing index. | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
119
|
-
| Reads data using an existing storing index. | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
120
|
-
| Read data using an existing index. | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
121
|
-
| Indexing | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
122
|
-
| Instance-with-processing-units | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
123
|
-
| Instance | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
124
|
-
| Json-add-column | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
125
|
-
| Json-query-parameter | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
126
|
-
| Json-update-data | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
127
|
-
| Lists all databases on the selected instance | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
128
|
-
| Lists all the available instance configs for the selected project. | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
129
|
-
| Numeric-add-column | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
130
|
-
| Numeric-query-parameter | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
131
|
-
| Numeric-update-data | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
132
|
-
| Queryoptions | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
133
|
-
| Quickstart | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
134
|
-
| Sets a request tag for a single query | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
135
|
-
| Rpc-priority | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
136
|
-
| Schema | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
137
|
-
| Struct | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
138
|
-
| Timestamp | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
139
|
-
| Executes a read/write transaction with transaction and request tags | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
140
|
-
| Transaction | [source code](https://github.com/googleapis/nodejs-spanner/blob/
|
|
93
|
+
| 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) |
|
|
94
|
+
| 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) |
|
|
95
|
+
| 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) |
|
|
96
|
+
| 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) |
|
|
97
|
+
| 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) |
|
|
98
|
+
| 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) |
|
|
99
|
+
| 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) |
|
|
100
|
+
| 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) |
|
|
101
|
+
| 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) |
|
|
102
|
+
| 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) |
|
|
103
|
+
| 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) |
|
|
104
|
+
| 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) |
|
|
105
|
+
| 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) |
|
|
106
|
+
| 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) |
|
|
107
|
+
| 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) |
|
|
108
|
+
| 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) |
|
|
109
|
+
| 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) |
|
|
110
|
+
| 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) |
|
|
111
|
+
| 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) |
|
|
112
|
+
| 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) |
|
|
113
|
+
| 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) |
|
|
114
|
+
| 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) |
|
|
115
|
+
| 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) |
|
|
116
|
+
| 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) |
|
|
117
|
+
| 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) |
|
|
118
|
+
| 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) |
|
|
119
|
+
| 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) |
|
|
120
|
+
| 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) |
|
|
121
|
+
| 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) |
|
|
122
|
+
| 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) |
|
|
123
|
+
| 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) |
|
|
124
|
+
| 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) |
|
|
125
|
+
| 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) |
|
|
126
|
+
| 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) |
|
|
127
|
+
| 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) |
|
|
128
|
+
| 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) |
|
|
129
|
+
| 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) |
|
|
130
|
+
| 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) |
|
|
131
|
+
| 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) |
|
|
132
|
+
| 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) |
|
|
133
|
+
| 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) |
|
|
134
|
+
| 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) |
|
|
135
|
+
| 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) |
|
|
136
|
+
| 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) |
|
|
137
|
+
| 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) |
|
|
138
|
+
| 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) |
|
|
139
|
+
| 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) |
|
|
140
|
+
| 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
141
|
|
|
142
142
|
|
|
143
143
|
|
|
@@ -180,13 +180,15 @@ are addressed with the highest priority.
|
|
|
180
180
|
|
|
181
181
|
|
|
182
182
|
|
|
183
|
+
|
|
184
|
+
|
|
183
185
|
More Information: [Google Cloud Platform Launch Stages][launch_stages]
|
|
184
186
|
|
|
185
187
|
[launch_stages]: https://cloud.google.com/terms/launch-stages
|
|
186
188
|
|
|
187
189
|
## Contributing
|
|
188
190
|
|
|
189
|
-
Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-spanner/blob/
|
|
191
|
+
Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-spanner/blob/main/CONTRIBUTING.md).
|
|
190
192
|
|
|
191
193
|
Please note that this `README.md`, the `samples/README.md`,
|
|
192
194
|
and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`)
|
|
@@ -198,7 +200,7 @@ to its templates in
|
|
|
198
200
|
|
|
199
201
|
Apache Version 2.0
|
|
200
202
|
|
|
201
|
-
See [LICENSE](https://github.com/googleapis/nodejs-spanner/blob/
|
|
203
|
+
See [LICENSE](https://github.com/googleapis/nodejs-spanner/blob/main/LICENSE)
|
|
202
204
|
|
|
203
205
|
[client-docs]: https://cloud.google.com/nodejs/docs/reference/spanner/latest
|
|
204
206
|
[product-docs]: https://cloud.google.com/spanner/docs/
|
package/build/protos/protos.d.ts
CHANGED
|
@@ -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. */
|
package/build/protos/protos.js
CHANGED
|
@@ -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
|
|
package/build/protos/protos.json
CHANGED
|
@@ -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": {
|
package/build/src/backup.d.ts
CHANGED
|
@@ -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
|
}
|