@google-cloud/spanner 7.9.1 → 7.11.0
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 +26 -0
- package/README.md +1 -0
- package/build/protos/google/spanner/admin/database/v1/backup.proto +17 -0
- package/build/protos/google/spanner/admin/database/v1/backup_schedule.proto +227 -0
- package/build/protos/google/spanner/admin/database/v1/spanner_database_admin.proto +60 -0
- package/build/protos/google/spanner/executor/v1/cloud_executor.proto +13 -0
- package/build/protos/google/spanner/v1/spanner.proto +78 -0
- package/build/protos/protos.d.ts +1416 -119
- package/build/protos/protos.js +3011 -2
- package/build/protos/protos.json +382 -11
- package/build/src/database.d.ts +55 -1
- package/build/src/database.js +47 -8
- package/build/src/index.d.ts +9 -1
- package/build/src/index.js +2 -1
- package/build/src/transaction.d.ts +91 -0
- package/build/src/transaction.js +104 -1
- package/build/src/v1/database_admin_client.d.ts +240 -0
- package/build/src/v1/database_admin_client.js +256 -0
- package/build/src/v1/database_admin_client_config.json +25 -0
- package/build/src/v1/database_admin_proto_list.json +1 -0
- package/build/src/v1/spanner_client.d.ts +22 -0
- package/build/src/v1/spanner_client.js +14 -6
- package/build/src/v1/spanner_executor_proxy_client.d.ts +42 -0
- package/build/src/v1/spanner_executor_proxy_client.js +59 -2
- package/build/src/v1/spanner_executor_proxy_proto_list.json +1 -0
- package/package.json +2 -2
|
@@ -155,6 +155,7 @@ class DatabaseAdminClient {
|
|
|
155
155
|
// Create useful helper objects for these.
|
|
156
156
|
this.pathTemplates = {
|
|
157
157
|
backupPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/instances/{instance}/backups/{backup}'),
|
|
158
|
+
backupSchedulePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/instances/{instance}/databases/{database}/backupSchedules/{schedule}'),
|
|
158
159
|
cryptoKeyPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}'),
|
|
159
160
|
databasePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/instances/{instance}/databases/{database}'),
|
|
160
161
|
databaseRolePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/instances/{instance}/databases/{database}/databaseRoles/{role}'),
|
|
@@ -169,6 +170,7 @@ class DatabaseAdminClient {
|
|
|
169
170
|
listDatabaseOperations: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'operations'),
|
|
170
171
|
listBackupOperations: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'operations'),
|
|
171
172
|
listDatabaseRoles: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'databaseRoles'),
|
|
173
|
+
listBackupSchedules: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'backupSchedules'),
|
|
172
174
|
};
|
|
173
175
|
const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
174
176
|
// This API contains "long-running operations", which return a
|
|
@@ -302,6 +304,11 @@ class DatabaseAdminClient {
|
|
|
302
304
|
'listDatabaseOperations',
|
|
303
305
|
'listBackupOperations',
|
|
304
306
|
'listDatabaseRoles',
|
|
307
|
+
'createBackupSchedule',
|
|
308
|
+
'getBackupSchedule',
|
|
309
|
+
'updateBackupSchedule',
|
|
310
|
+
'deleteBackupSchedule',
|
|
311
|
+
'listBackupSchedules',
|
|
305
312
|
];
|
|
306
313
|
for (const methodName of databaseAdminStubMethods) {
|
|
307
314
|
const callPromise = this.databaseAdminStub.then(stub => (...args) => {
|
|
@@ -573,6 +580,90 @@ class DatabaseAdminClient {
|
|
|
573
580
|
this.initialize();
|
|
574
581
|
return this.innerApiCalls.deleteBackup(request, options, callback);
|
|
575
582
|
}
|
|
583
|
+
createBackupSchedule(request, optionsOrCallback, callback) {
|
|
584
|
+
var _a;
|
|
585
|
+
request = request || {};
|
|
586
|
+
let options;
|
|
587
|
+
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
588
|
+
callback = optionsOrCallback;
|
|
589
|
+
options = {};
|
|
590
|
+
}
|
|
591
|
+
else {
|
|
592
|
+
options = optionsOrCallback;
|
|
593
|
+
}
|
|
594
|
+
options = options || {};
|
|
595
|
+
options.otherArgs = options.otherArgs || {};
|
|
596
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
597
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
598
|
+
this._gaxModule.routingHeader.fromParams({
|
|
599
|
+
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
|
|
600
|
+
});
|
|
601
|
+
this.initialize();
|
|
602
|
+
return this.innerApiCalls.createBackupSchedule(request, options, callback);
|
|
603
|
+
}
|
|
604
|
+
getBackupSchedule(request, optionsOrCallback, callback) {
|
|
605
|
+
var _a;
|
|
606
|
+
request = request || {};
|
|
607
|
+
let options;
|
|
608
|
+
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
609
|
+
callback = optionsOrCallback;
|
|
610
|
+
options = {};
|
|
611
|
+
}
|
|
612
|
+
else {
|
|
613
|
+
options = optionsOrCallback;
|
|
614
|
+
}
|
|
615
|
+
options = options || {};
|
|
616
|
+
options.otherArgs = options.otherArgs || {};
|
|
617
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
618
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
619
|
+
this._gaxModule.routingHeader.fromParams({
|
|
620
|
+
name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
|
|
621
|
+
});
|
|
622
|
+
this.initialize();
|
|
623
|
+
return this.innerApiCalls.getBackupSchedule(request, options, callback);
|
|
624
|
+
}
|
|
625
|
+
updateBackupSchedule(request, optionsOrCallback, callback) {
|
|
626
|
+
var _a;
|
|
627
|
+
request = request || {};
|
|
628
|
+
let options;
|
|
629
|
+
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
630
|
+
callback = optionsOrCallback;
|
|
631
|
+
options = {};
|
|
632
|
+
}
|
|
633
|
+
else {
|
|
634
|
+
options = optionsOrCallback;
|
|
635
|
+
}
|
|
636
|
+
options = options || {};
|
|
637
|
+
options.otherArgs = options.otherArgs || {};
|
|
638
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
639
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
640
|
+
this._gaxModule.routingHeader.fromParams({
|
|
641
|
+
'backup_schedule.name': (_a = request.backupSchedule.name) !== null && _a !== void 0 ? _a : '',
|
|
642
|
+
});
|
|
643
|
+
this.initialize();
|
|
644
|
+
return this.innerApiCalls.updateBackupSchedule(request, options, callback);
|
|
645
|
+
}
|
|
646
|
+
deleteBackupSchedule(request, optionsOrCallback, callback) {
|
|
647
|
+
var _a;
|
|
648
|
+
request = request || {};
|
|
649
|
+
let options;
|
|
650
|
+
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
651
|
+
callback = optionsOrCallback;
|
|
652
|
+
options = {};
|
|
653
|
+
}
|
|
654
|
+
else {
|
|
655
|
+
options = optionsOrCallback;
|
|
656
|
+
}
|
|
657
|
+
options = options || {};
|
|
658
|
+
options.otherArgs = options.otherArgs || {};
|
|
659
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
660
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
661
|
+
this._gaxModule.routingHeader.fromParams({
|
|
662
|
+
name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
|
|
663
|
+
});
|
|
664
|
+
this.initialize();
|
|
665
|
+
return this.innerApiCalls.deleteBackupSchedule(request, options, callback);
|
|
666
|
+
}
|
|
576
667
|
createDatabase(request, optionsOrCallback, callback) {
|
|
577
668
|
var _a;
|
|
578
669
|
request = request || {};
|
|
@@ -1627,6 +1718,114 @@ class DatabaseAdminClient {
|
|
|
1627
1718
|
this.initialize();
|
|
1628
1719
|
return this.descriptors.page.listDatabaseRoles.asyncIterate(this.innerApiCalls['listDatabaseRoles'], request, callSettings);
|
|
1629
1720
|
}
|
|
1721
|
+
listBackupSchedules(request, optionsOrCallback, callback) {
|
|
1722
|
+
var _a;
|
|
1723
|
+
request = request || {};
|
|
1724
|
+
let options;
|
|
1725
|
+
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
1726
|
+
callback = optionsOrCallback;
|
|
1727
|
+
options = {};
|
|
1728
|
+
}
|
|
1729
|
+
else {
|
|
1730
|
+
options = optionsOrCallback;
|
|
1731
|
+
}
|
|
1732
|
+
options = options || {};
|
|
1733
|
+
options.otherArgs = options.otherArgs || {};
|
|
1734
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1735
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
1736
|
+
this._gaxModule.routingHeader.fromParams({
|
|
1737
|
+
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
|
|
1738
|
+
});
|
|
1739
|
+
this.initialize();
|
|
1740
|
+
return this.innerApiCalls.listBackupSchedules(request, options, callback);
|
|
1741
|
+
}
|
|
1742
|
+
/**
|
|
1743
|
+
* Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
|
|
1744
|
+
* @param {Object} request
|
|
1745
|
+
* The request object that will be sent.
|
|
1746
|
+
* @param {string} request.parent
|
|
1747
|
+
* Required. Database is the parent resource whose backup schedules should be
|
|
1748
|
+
* listed. Values are of the form
|
|
1749
|
+
* projects/<project>/instances/<instance>/databases/<database>
|
|
1750
|
+
* @param {number} [request.pageSize]
|
|
1751
|
+
* Optional. Number of backup schedules to be returned in the response. If 0
|
|
1752
|
+
* or less, defaults to the server's maximum allowed page size.
|
|
1753
|
+
* @param {string} [request.pageToken]
|
|
1754
|
+
* Optional. If non-empty, `page_token` should contain a
|
|
1755
|
+
* {@link protos.google.spanner.admin.database.v1.ListBackupSchedulesResponse.next_page_token|next_page_token}
|
|
1756
|
+
* from a previous
|
|
1757
|
+
* {@link protos.google.spanner.admin.database.v1.ListBackupSchedulesResponse|ListBackupSchedulesResponse}
|
|
1758
|
+
* to the same `parent`.
|
|
1759
|
+
* @param {object} [options]
|
|
1760
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
1761
|
+
* @returns {Stream}
|
|
1762
|
+
* An object stream which emits an object representing {@link protos.google.spanner.admin.database.v1.BackupSchedule|BackupSchedule} on 'data' event.
|
|
1763
|
+
* The client library will perform auto-pagination by default: it will call the API as many
|
|
1764
|
+
* times as needed. Note that it can affect your quota.
|
|
1765
|
+
* We recommend using `listBackupSchedulesAsync()`
|
|
1766
|
+
* method described below for async iteration which you can stop as needed.
|
|
1767
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
|
1768
|
+
* for more details and examples.
|
|
1769
|
+
*/
|
|
1770
|
+
listBackupSchedulesStream(request, options) {
|
|
1771
|
+
var _a;
|
|
1772
|
+
request = request || {};
|
|
1773
|
+
options = options || {};
|
|
1774
|
+
options.otherArgs = options.otherArgs || {};
|
|
1775
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1776
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
1777
|
+
this._gaxModule.routingHeader.fromParams({
|
|
1778
|
+
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
|
|
1779
|
+
});
|
|
1780
|
+
const defaultCallSettings = this._defaults['listBackupSchedules'];
|
|
1781
|
+
const callSettings = defaultCallSettings.merge(options);
|
|
1782
|
+
this.initialize();
|
|
1783
|
+
return this.descriptors.page.listBackupSchedules.createStream(this.innerApiCalls.listBackupSchedules, request, callSettings);
|
|
1784
|
+
}
|
|
1785
|
+
/**
|
|
1786
|
+
* Equivalent to `listBackupSchedules`, but returns an iterable object.
|
|
1787
|
+
*
|
|
1788
|
+
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
|
|
1789
|
+
* @param {Object} request
|
|
1790
|
+
* The request object that will be sent.
|
|
1791
|
+
* @param {string} request.parent
|
|
1792
|
+
* Required. Database is the parent resource whose backup schedules should be
|
|
1793
|
+
* listed. Values are of the form
|
|
1794
|
+
* projects/<project>/instances/<instance>/databases/<database>
|
|
1795
|
+
* @param {number} [request.pageSize]
|
|
1796
|
+
* Optional. Number of backup schedules to be returned in the response. If 0
|
|
1797
|
+
* or less, defaults to the server's maximum allowed page size.
|
|
1798
|
+
* @param {string} [request.pageToken]
|
|
1799
|
+
* Optional. If non-empty, `page_token` should contain a
|
|
1800
|
+
* {@link protos.google.spanner.admin.database.v1.ListBackupSchedulesResponse.next_page_token|next_page_token}
|
|
1801
|
+
* from a previous
|
|
1802
|
+
* {@link protos.google.spanner.admin.database.v1.ListBackupSchedulesResponse|ListBackupSchedulesResponse}
|
|
1803
|
+
* to the same `parent`.
|
|
1804
|
+
* @param {object} [options]
|
|
1805
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
1806
|
+
* @returns {Object}
|
|
1807
|
+
* An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
|
|
1808
|
+
* When you iterate the returned iterable, each element will be an object representing
|
|
1809
|
+
* {@link protos.google.spanner.admin.database.v1.BackupSchedule|BackupSchedule}. The API will be called under the hood as needed, once per the page,
|
|
1810
|
+
* so you can stop the iteration when you don't need more results.
|
|
1811
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
|
|
1812
|
+
* for more details and examples.
|
|
1813
|
+
*/
|
|
1814
|
+
listBackupSchedulesAsync(request, options) {
|
|
1815
|
+
var _a;
|
|
1816
|
+
request = request || {};
|
|
1817
|
+
options = options || {};
|
|
1818
|
+
options.otherArgs = options.otherArgs || {};
|
|
1819
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1820
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
1821
|
+
this._gaxModule.routingHeader.fromParams({
|
|
1822
|
+
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
|
|
1823
|
+
});
|
|
1824
|
+
const defaultCallSettings = this._defaults['listBackupSchedules'];
|
|
1825
|
+
const callSettings = defaultCallSettings.merge(options);
|
|
1826
|
+
this.initialize();
|
|
1827
|
+
return this.descriptors.page.listBackupSchedules.asyncIterate(this.innerApiCalls['listBackupSchedules'], request, callSettings);
|
|
1828
|
+
}
|
|
1630
1829
|
/**
|
|
1631
1830
|
* Gets the latest state of a long-running operation. Clients can use this
|
|
1632
1831
|
* method to poll the operation result at intervals as recommended by the API
|
|
@@ -1803,6 +2002,63 @@ class DatabaseAdminClient {
|
|
|
1803
2002
|
matchBackupFromBackupName(backupName) {
|
|
1804
2003
|
return this.pathTemplates.backupPathTemplate.match(backupName).backup;
|
|
1805
2004
|
}
|
|
2005
|
+
/**
|
|
2006
|
+
* Return a fully-qualified backupSchedule resource name string.
|
|
2007
|
+
*
|
|
2008
|
+
* @param {string} project
|
|
2009
|
+
* @param {string} instance
|
|
2010
|
+
* @param {string} database
|
|
2011
|
+
* @param {string} schedule
|
|
2012
|
+
* @returns {string} Resource name string.
|
|
2013
|
+
*/
|
|
2014
|
+
backupSchedulePath(project, instance, database, schedule) {
|
|
2015
|
+
return this.pathTemplates.backupSchedulePathTemplate.render({
|
|
2016
|
+
project: project,
|
|
2017
|
+
instance: instance,
|
|
2018
|
+
database: database,
|
|
2019
|
+
schedule: schedule,
|
|
2020
|
+
});
|
|
2021
|
+
}
|
|
2022
|
+
/**
|
|
2023
|
+
* Parse the project from BackupSchedule resource.
|
|
2024
|
+
*
|
|
2025
|
+
* @param {string} backupScheduleName
|
|
2026
|
+
* A fully-qualified path representing BackupSchedule resource.
|
|
2027
|
+
* @returns {string} A string representing the project.
|
|
2028
|
+
*/
|
|
2029
|
+
matchProjectFromBackupScheduleName(backupScheduleName) {
|
|
2030
|
+
return this.pathTemplates.backupSchedulePathTemplate.match(backupScheduleName).project;
|
|
2031
|
+
}
|
|
2032
|
+
/**
|
|
2033
|
+
* Parse the instance from BackupSchedule resource.
|
|
2034
|
+
*
|
|
2035
|
+
* @param {string} backupScheduleName
|
|
2036
|
+
* A fully-qualified path representing BackupSchedule resource.
|
|
2037
|
+
* @returns {string} A string representing the instance.
|
|
2038
|
+
*/
|
|
2039
|
+
matchInstanceFromBackupScheduleName(backupScheduleName) {
|
|
2040
|
+
return this.pathTemplates.backupSchedulePathTemplate.match(backupScheduleName).instance;
|
|
2041
|
+
}
|
|
2042
|
+
/**
|
|
2043
|
+
* Parse the database from BackupSchedule resource.
|
|
2044
|
+
*
|
|
2045
|
+
* @param {string} backupScheduleName
|
|
2046
|
+
* A fully-qualified path representing BackupSchedule resource.
|
|
2047
|
+
* @returns {string} A string representing the database.
|
|
2048
|
+
*/
|
|
2049
|
+
matchDatabaseFromBackupScheduleName(backupScheduleName) {
|
|
2050
|
+
return this.pathTemplates.backupSchedulePathTemplate.match(backupScheduleName).database;
|
|
2051
|
+
}
|
|
2052
|
+
/**
|
|
2053
|
+
* Parse the schedule from BackupSchedule resource.
|
|
2054
|
+
*
|
|
2055
|
+
* @param {string} backupScheduleName
|
|
2056
|
+
* A fully-qualified path representing BackupSchedule resource.
|
|
2057
|
+
* @returns {string} A string representing the schedule.
|
|
2058
|
+
*/
|
|
2059
|
+
matchScheduleFromBackupScheduleName(backupScheduleName) {
|
|
2060
|
+
return this.pathTemplates.backupSchedulePathTemplate.match(backupScheduleName).schedule;
|
|
2061
|
+
}
|
|
1806
2062
|
/**
|
|
1807
2063
|
* Return a fully-qualified cryptoKey resource name string.
|
|
1808
2064
|
*
|
|
@@ -128,6 +128,31 @@
|
|
|
128
128
|
"timeout_millis": 3600000,
|
|
129
129
|
"retry_codes_name": "idempotent",
|
|
130
130
|
"retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799"
|
|
131
|
+
},
|
|
132
|
+
"CreateBackupSchedule": {
|
|
133
|
+
"timeout_millis": 3600000,
|
|
134
|
+
"retry_codes_name": "idempotent",
|
|
135
|
+
"retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799"
|
|
136
|
+
},
|
|
137
|
+
"GetBackupSchedule": {
|
|
138
|
+
"timeout_millis": 3600000,
|
|
139
|
+
"retry_codes_name": "idempotent",
|
|
140
|
+
"retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799"
|
|
141
|
+
},
|
|
142
|
+
"UpdateBackupSchedule": {
|
|
143
|
+
"timeout_millis": 3600000,
|
|
144
|
+
"retry_codes_name": "idempotent",
|
|
145
|
+
"retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799"
|
|
146
|
+
},
|
|
147
|
+
"DeleteBackupSchedule": {
|
|
148
|
+
"timeout_millis": 3600000,
|
|
149
|
+
"retry_codes_name": "idempotent",
|
|
150
|
+
"retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799"
|
|
151
|
+
},
|
|
152
|
+
"ListBackupSchedules": {
|
|
153
|
+
"timeout_millis": 3600000,
|
|
154
|
+
"retry_codes_name": "idempotent",
|
|
155
|
+
"retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799"
|
|
131
156
|
}
|
|
132
157
|
}
|
|
133
158
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
[
|
|
2
2
|
"../../protos/google/spanner/admin/database/v1/backup.proto",
|
|
3
|
+
"../../protos/google/spanner/admin/database/v1/backup_schedule.proto",
|
|
3
4
|
"../../protos/google/spanner/admin/database/v1/common.proto",
|
|
4
5
|
"../../protos/google/spanner/admin/database/v1/spanner_database_admin.proto"
|
|
5
6
|
]
|
|
@@ -483,6 +483,17 @@ export declare class SpannerClient {
|
|
|
483
483
|
*
|
|
484
484
|
* If the field is set to `true` but the request does not set
|
|
485
485
|
* `partition_token`, the API returns an `INVALID_ARGUMENT` error.
|
|
486
|
+
* @param {google.spanner.v1.ReadRequest.OrderBy} [request.orderBy]
|
|
487
|
+
* Optional. Order for the returned rows.
|
|
488
|
+
*
|
|
489
|
+
* By default, Spanner will return result rows in primary key order except for
|
|
490
|
+
* PartitionRead requests. For applications that do not require rows to be
|
|
491
|
+
* returned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting
|
|
492
|
+
* `ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval,
|
|
493
|
+
* resulting in lower latencies in certain cases (e.g. bulk point lookups).
|
|
494
|
+
* @param {google.spanner.v1.ReadRequest.LockHint} [request.lockHint]
|
|
495
|
+
* Optional. Lock Hint for the request, it can only be used with read-write
|
|
496
|
+
* transactions.
|
|
486
497
|
* @param {object} [options]
|
|
487
498
|
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
488
499
|
* @returns {Promise} - The promise which resolves to an array.
|
|
@@ -925,6 +936,17 @@ export declare class SpannerClient {
|
|
|
925
936
|
*
|
|
926
937
|
* If the field is set to `true` but the request does not set
|
|
927
938
|
* `partition_token`, the API returns an `INVALID_ARGUMENT` error.
|
|
939
|
+
* @param {google.spanner.v1.ReadRequest.OrderBy} [request.orderBy]
|
|
940
|
+
* Optional. Order for the returned rows.
|
|
941
|
+
*
|
|
942
|
+
* By default, Spanner will return result rows in primary key order except for
|
|
943
|
+
* PartitionRead requests. For applications that do not require rows to be
|
|
944
|
+
* returned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting
|
|
945
|
+
* `ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval,
|
|
946
|
+
* resulting in lower latencies in certain cases (e.g. bulk point lookups).
|
|
947
|
+
* @param {google.spanner.v1.ReadRequest.LockHint} [request.lockHint]
|
|
948
|
+
* Optional. Lock Hint for the request, it can only be used with read-write
|
|
949
|
+
* transactions.
|
|
928
950
|
* @param {object} [options]
|
|
929
951
|
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
930
952
|
* @returns {Stream}
|
|
@@ -164,12 +164,9 @@ class SpannerClient {
|
|
|
164
164
|
// Some of the methods on this service provide streaming responses.
|
|
165
165
|
// Provide descriptors for these.
|
|
166
166
|
this.descriptors.stream = {
|
|
167
|
-
executeStreamingSql: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback,
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
/* gaxStreamingRetries: */ false),
|
|
171
|
-
batchWrite: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback,
|
|
172
|
-
/* gaxStreamingRetries: */ false),
|
|
167
|
+
executeStreamingSql: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries),
|
|
168
|
+
streamingRead: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries),
|
|
169
|
+
batchWrite: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries),
|
|
173
170
|
};
|
|
174
171
|
// Put together the default options sent with requests.
|
|
175
172
|
this._defaults = this._gaxGrpc.constructSettings('google.spanner.v1.Spanner', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
|
|
@@ -741,6 +738,17 @@ class SpannerClient {
|
|
|
741
738
|
*
|
|
742
739
|
* If the field is set to `true` but the request does not set
|
|
743
740
|
* `partition_token`, the API returns an `INVALID_ARGUMENT` error.
|
|
741
|
+
* @param {google.spanner.v1.ReadRequest.OrderBy} [request.orderBy]
|
|
742
|
+
* Optional. Order for the returned rows.
|
|
743
|
+
*
|
|
744
|
+
* By default, Spanner will return result rows in primary key order except for
|
|
745
|
+
* PartitionRead requests. For applications that do not require rows to be
|
|
746
|
+
* returned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting
|
|
747
|
+
* `ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval,
|
|
748
|
+
* resulting in lower latencies in certain cases (e.g. bulk point lookups).
|
|
749
|
+
* @param {google.spanner.v1.ReadRequest.LockHint} [request.lockHint]
|
|
750
|
+
* Optional. Lock Hint for the request, it can only be used with read-write
|
|
751
|
+
* transactions.
|
|
744
752
|
* @param {object} [options]
|
|
745
753
|
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
746
754
|
* @returns {Stream}
|
|
@@ -168,6 +168,48 @@ export declare class SpannerExecutorProxyClient {
|
|
|
168
168
|
* @returns {string} A string representing the backup.
|
|
169
169
|
*/
|
|
170
170
|
matchBackupFromBackupName(backupName: string): string | number;
|
|
171
|
+
/**
|
|
172
|
+
* Return a fully-qualified backupSchedule resource name string.
|
|
173
|
+
*
|
|
174
|
+
* @param {string} project
|
|
175
|
+
* @param {string} instance
|
|
176
|
+
* @param {string} database
|
|
177
|
+
* @param {string} schedule
|
|
178
|
+
* @returns {string} Resource name string.
|
|
179
|
+
*/
|
|
180
|
+
backupSchedulePath(project: string, instance: string, database: string, schedule: string): string;
|
|
181
|
+
/**
|
|
182
|
+
* Parse the project from BackupSchedule resource.
|
|
183
|
+
*
|
|
184
|
+
* @param {string} backupScheduleName
|
|
185
|
+
* A fully-qualified path representing BackupSchedule resource.
|
|
186
|
+
* @returns {string} A string representing the project.
|
|
187
|
+
*/
|
|
188
|
+
matchProjectFromBackupScheduleName(backupScheduleName: string): string | number;
|
|
189
|
+
/**
|
|
190
|
+
* Parse the instance from BackupSchedule resource.
|
|
191
|
+
*
|
|
192
|
+
* @param {string} backupScheduleName
|
|
193
|
+
* A fully-qualified path representing BackupSchedule resource.
|
|
194
|
+
* @returns {string} A string representing the instance.
|
|
195
|
+
*/
|
|
196
|
+
matchInstanceFromBackupScheduleName(backupScheduleName: string): string | number;
|
|
197
|
+
/**
|
|
198
|
+
* Parse the database from BackupSchedule resource.
|
|
199
|
+
*
|
|
200
|
+
* @param {string} backupScheduleName
|
|
201
|
+
* A fully-qualified path representing BackupSchedule resource.
|
|
202
|
+
* @returns {string} A string representing the database.
|
|
203
|
+
*/
|
|
204
|
+
matchDatabaseFromBackupScheduleName(backupScheduleName: string): string | number;
|
|
205
|
+
/**
|
|
206
|
+
* Parse the schedule from BackupSchedule resource.
|
|
207
|
+
*
|
|
208
|
+
* @param {string} backupScheduleName
|
|
209
|
+
* A fully-qualified path representing BackupSchedule resource.
|
|
210
|
+
* @returns {string} A string representing the schedule.
|
|
211
|
+
*/
|
|
212
|
+
matchScheduleFromBackupScheduleName(backupScheduleName: string): string | number;
|
|
171
213
|
/**
|
|
172
214
|
* Return a fully-qualified database resource name string.
|
|
173
215
|
*
|
|
@@ -148,6 +148,7 @@ class SpannerExecutorProxyClient {
|
|
|
148
148
|
// Create useful helper objects for these.
|
|
149
149
|
this.pathTemplates = {
|
|
150
150
|
backupPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/instances/{instance}/backups/{backup}'),
|
|
151
|
+
backupSchedulePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/instances/{instance}/databases/{database}/backupSchedules/{schedule}'),
|
|
151
152
|
databasePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/instances/{instance}/databases/{database}'),
|
|
152
153
|
databaseRolePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/instances/{instance}/databases/{database}/databaseRoles/{role}'),
|
|
153
154
|
instancePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/instances/{instance}'),
|
|
@@ -158,8 +159,7 @@ class SpannerExecutorProxyClient {
|
|
|
158
159
|
// Some of the methods on this service provide streaming responses.
|
|
159
160
|
// Provide descriptors for these.
|
|
160
161
|
this.descriptors.stream = {
|
|
161
|
-
executeActionAsync: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.BIDI_STREAMING, !!opts.fallback,
|
|
162
|
-
/* gaxStreamingRetries: */ false),
|
|
162
|
+
executeActionAsync: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.BIDI_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries),
|
|
163
163
|
};
|
|
164
164
|
// Put together the default options sent with requests.
|
|
165
165
|
this._defaults = this._gaxGrpc.constructSettings('google.spanner.executor.v1.SpannerExecutorProxy', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
|
|
@@ -355,6 +355,63 @@ class SpannerExecutorProxyClient {
|
|
|
355
355
|
matchBackupFromBackupName(backupName) {
|
|
356
356
|
return this.pathTemplates.backupPathTemplate.match(backupName).backup;
|
|
357
357
|
}
|
|
358
|
+
/**
|
|
359
|
+
* Return a fully-qualified backupSchedule resource name string.
|
|
360
|
+
*
|
|
361
|
+
* @param {string} project
|
|
362
|
+
* @param {string} instance
|
|
363
|
+
* @param {string} database
|
|
364
|
+
* @param {string} schedule
|
|
365
|
+
* @returns {string} Resource name string.
|
|
366
|
+
*/
|
|
367
|
+
backupSchedulePath(project, instance, database, schedule) {
|
|
368
|
+
return this.pathTemplates.backupSchedulePathTemplate.render({
|
|
369
|
+
project: project,
|
|
370
|
+
instance: instance,
|
|
371
|
+
database: database,
|
|
372
|
+
schedule: schedule,
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Parse the project from BackupSchedule resource.
|
|
377
|
+
*
|
|
378
|
+
* @param {string} backupScheduleName
|
|
379
|
+
* A fully-qualified path representing BackupSchedule resource.
|
|
380
|
+
* @returns {string} A string representing the project.
|
|
381
|
+
*/
|
|
382
|
+
matchProjectFromBackupScheduleName(backupScheduleName) {
|
|
383
|
+
return this.pathTemplates.backupSchedulePathTemplate.match(backupScheduleName).project;
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Parse the instance from BackupSchedule resource.
|
|
387
|
+
*
|
|
388
|
+
* @param {string} backupScheduleName
|
|
389
|
+
* A fully-qualified path representing BackupSchedule resource.
|
|
390
|
+
* @returns {string} A string representing the instance.
|
|
391
|
+
*/
|
|
392
|
+
matchInstanceFromBackupScheduleName(backupScheduleName) {
|
|
393
|
+
return this.pathTemplates.backupSchedulePathTemplate.match(backupScheduleName).instance;
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* Parse the database from BackupSchedule resource.
|
|
397
|
+
*
|
|
398
|
+
* @param {string} backupScheduleName
|
|
399
|
+
* A fully-qualified path representing BackupSchedule resource.
|
|
400
|
+
* @returns {string} A string representing the database.
|
|
401
|
+
*/
|
|
402
|
+
matchDatabaseFromBackupScheduleName(backupScheduleName) {
|
|
403
|
+
return this.pathTemplates.backupSchedulePathTemplate.match(backupScheduleName).database;
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* Parse the schedule from BackupSchedule resource.
|
|
407
|
+
*
|
|
408
|
+
* @param {string} backupScheduleName
|
|
409
|
+
* A fully-qualified path representing BackupSchedule resource.
|
|
410
|
+
* @returns {string} A string representing the schedule.
|
|
411
|
+
*/
|
|
412
|
+
matchScheduleFromBackupScheduleName(backupScheduleName) {
|
|
413
|
+
return this.pathTemplates.backupSchedulePathTemplate.match(backupScheduleName).schedule;
|
|
414
|
+
}
|
|
358
415
|
/**
|
|
359
416
|
* Return a fully-qualified database resource name string.
|
|
360
417
|
*
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
[
|
|
2
2
|
"../../protos/google/spanner/admin/database/v1/backup.proto",
|
|
3
|
+
"../../protos/google/spanner/admin/database/v1/backup_schedule.proto",
|
|
3
4
|
"../../protos/google/spanner/admin/database/v1/common.proto",
|
|
4
5
|
"../../protos/google/spanner/admin/instance/v1/common.proto",
|
|
5
6
|
"../../protos/google/spanner/executor/v1/cloud_executor.proto",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@google-cloud/spanner",
|
|
3
3
|
"description": "Cloud Spanner Client Library for Node.js",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.11.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Google Inc.",
|
|
7
7
|
"engines": {
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"events-intercept": "^2.0.0",
|
|
67
67
|
"extend": "^3.0.2",
|
|
68
68
|
"google-auth-library": "^9.0.0",
|
|
69
|
-
"google-gax": "4.3.
|
|
69
|
+
"google-gax": "4.3.8",
|
|
70
70
|
"grpc-gcp": "^1.0.0",
|
|
71
71
|
"is": "^3.2.1",
|
|
72
72
|
"lodash.snakecase": "^4.1.1",
|