Skip to content

Commit a3d4b8e

Browse files
committed
spanner: documentation corrections
1 parent 3108fd2 commit a3d4b8e

File tree

3 files changed

+26
-37
lines changed

3 files changed

+26
-37
lines changed

packages/spanner/src/database.js

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -415,13 +415,15 @@ Database.prototype.getSchema = function(callback) {
415415
* @param {boolean} options.readOnly - Specifies if the transaction is
416416
* read-only. Default: `false`.
417417
* @param {number} options.exactStaleness - Executes all reads at the timestamp
418-
* that is `exactStaleness` old.
418+
* that is `exactStaleness` old. This is only applicable for read-only
419+
* transactions.
419420
* @param {date} options.readTimestamp - Execute all reads at the given
420-
* timestamp.
421+
* timestamp. This is only applicable for read-only transactions.
421422
* @param {boolean} options.returnTimestamp - If `true`, returns the read
422423
* timestamp.
423424
* @param {boolean} options.strong - Read at the timestamp where all previously
424-
* committed transactions are visible.
425+
* committed transactions are visible. This is only applicable for read-only
426+
* transactions.
425427
* @param {function} callback - The callback function.
426428
* @param {?error} callback.err - An error returned while getting the
427429
* transaction object.
@@ -489,8 +491,6 @@ Database.prototype.getTransaction = function(options, callback) {
489491
* that is `exactStaleness` old.
490492
* @param {date} options.readTimestamp - Execute all reads at the given
491493
* timestamp.
492-
* @param {boolean} options.returnTimestamp - If `true`, returns the read
493-
* timestamp.
494494
* @param {boolean} options.strong - Read at the timestamp where all previously
495495
* committed transactions are visible.
496496
* @param {function=} callback - The callback function.
@@ -610,8 +610,6 @@ Database.prototype.run = function(query, options, callback) {
610610
* that is `exactStaleness` old.
611611
* @param {date} options.readTimestamp - Execute all reads at the given
612612
* timestamp.
613-
* @param {boolean} options.returnTimestamp - If `true`, returns the read
614-
* timestamp.
615613
* @param {boolean} options.strong - Read at the timestamp where all previously
616614
* committed transactions are visible.
617615
* @return {Stream}
@@ -797,6 +795,10 @@ Database.prototype.runStream = function(query, options) {
797795
* object. The Transaction object will let you run queries and queue mutations
798796
* until you are ready to {module:spanner/transaction#commit}.
799797
*
798+
* In the event that an aborted error occurs, we will re-run the `runFn` in its
799+
* entirety. If you prefer to handle aborted errors for yourself please refer to
800+
* {module:spanner/database#getTransaction}.
801+
*
800802
* For a more complete listing of functionality available to a Transaction, see
801803
* the {module:spanner/transaction} API documentation. For a general overview of
802804
* transactions within Cloud Spanner, see
@@ -814,13 +816,16 @@ Database.prototype.runStream = function(query, options) {
814816
* @param {boolean} options.readOnly - Specifies if the transaction is
815817
* read-only.
816818
* @param {number} options.exactStaleness - Executes all reads at the timestamp
817-
* that is `exactStaleness` old.
819+
* that is `exactStaleness` old. This is only applicable for read-only
820+
* transactions.
818821
* @param {date} options.readTimestamp - Execute all reads at the given
819-
* timestamp.
822+
* timestamp. This is only applicable for read-only
823+
* transactions.
820824
* @param {boolean} options.returnTimestamp - If `true`, returns the read
821825
* timestamp.
822826
* @param {boolean} options.strong - Read at the timestamp where all previously
823-
* committed transactions are visible.
827+
* committed transactions are visible. This is only applicable for read-only
828+
* transactions.
824829
* @param {function} runFn - A function to execute in the context of a
825830
* transaction.
826831
* @param {?error} runFn.err - An error returned while making this request.

packages/spanner/src/transaction-request.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,6 @@ TransactionRequest.prototype.createReadStream = function(table, query) {
286286
* @param {string} table - The name of the table.
287287
* @param {*[]|*[][]} keys - The keys for the rows to delete. If using a
288288
* composite key, provide an array within this array. See the example below.
289-
* @param {function} callback - The callback function.
290-
* @param {?error} callback.err - An error returned while making this request.
291-
* @param {object} callback.apiResponse - The full API response.
292289
*
293290
* @example
294291
* var keys = ['Id1', 'Id2', 'Id3'];
@@ -537,10 +534,6 @@ TransactionRequest.prototype.read = function(table, keyVals, callback) {
537534
* @param {string} table - The table to read from.
538535
* @param {object|object[]} keyVals - A map of names to values of data to insert
539536
* into this table.
540-
* @param {function} callback - The callback function.
541-
* @param {?error} callback.err - An error returned while making this
542-
* request.
543-
* @param {object} callback.apiResponse - The full API response.
544537
*
545538
* @example
546539
* var row = {
@@ -595,10 +588,6 @@ TransactionRequest.prototype.requestStream = function() {};
595588
* @param {string} table - The table to read from.
596589
* @param {object|object[]} keyVals - A map of names to values of data to insert
597590
* into this table.
598-
* @param {function} callback - The callback function.
599-
* @param {?error} callback.err - An error returned while making this
600-
* request.
601-
* @param {object} callback.apiResponse - The full API response.
602591
*
603592
* @example
604593
* var row = {
@@ -635,10 +624,6 @@ TransactionRequest.prototype.update = function(table, keyVals, callback) {
635624
* @param {string} table - The table to read from.
636625
* @param {object|object[]} keyVals - A map of names to values of data to insert
637626
* into this table.
638-
* @param {function} callback - The callback function.
639-
* @param {?error} callback.err - An error returned while making this
640-
* request.
641-
* @param {object} callback.apiResponse - The full API response.
642627
*
643628
* @example
644629
* var row = {

packages/spanner/src/transaction.js

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,6 @@ var ABORTED = 10;
5454
/*! Developer Documentation
5555
*
5656
* @param {module:spanner/session} session - The parent Session object.
57-
*/
58-
/**
59-
* Use a Transaction object to read and write against inside of your Cloud
60-
* Spanner database.
61-
*
62-
* **This object is created and returned from
63-
* {module:database/runTransaction}.**
64-
*
65-
* @constructor
66-
* @alias module:spanner/transaction
67-
* @mixes module:spanner/transaction-request
68-
*
6957
* @param {object=} options - [Transaction options](https://cloud.google.com/spanner/docs/timestamp-bounds).
7058
* @param {number} options.exactStaleness - Executes all reads at the timestamp
7159
* that is `exactStaleness` old.
@@ -81,6 +69,17 @@ var ABORTED = 10;
8169
* timestamp.
8270
* @param {boolean} options.strong - Read at the timestamp where all previously
8371
* committed transactions are visible.
72+
*/
73+
/**
74+
* Use a Transaction object to read and write against inside of your Cloud
75+
* Spanner database.
76+
*
77+
* **This object is created and returned from
78+
* {module:spanner/database#runTransaction}.**
79+
*
80+
* @constructor
81+
* @alias module:spanner/transaction
82+
* @mixes module:spanner/transaction-request
8483
*
8584
* @example
8685
* var instance = spanner.instance('my-instance');

0 commit comments

Comments
 (0)