Skip to content

Commit 3956d5c

Browse files
romlogicJustinBeckwith
authored andcommitted
docs: Update grammar (#544)
1 parent bb7e08e commit 3956d5c

1 file changed

Lines changed: 35 additions & 35 deletions

File tree

handwritten/spanner/src/transaction.ts

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ export interface RunUpdateCallback {
126126
* but does not allow writes. Snapshot read-only transactions can be configured
127127
* to read at timestamps in the past.
128128
*
129-
* When finished with the Snapshot, you should call {@link Snapshot#end} to
130-
* release the underlying {@link Session}. Failure to do can result in a
129+
* When finished with the Snapshot, call {@link Snapshot#end} to
130+
* release the underlying {@link Session}. Failure to do so can result in a
131131
* Session leak.
132132
*
133133
* **This object is created and returned from {@link Database#getSnapshot}.**
@@ -153,7 +153,7 @@ export interface RunUpdateCallback {
153153
* // Error handling omitted.
154154
* }
155155
*
156-
* // should be called when finished with the snapshot
156+
* // It should be called when the snapshot finishes.
157157
* transaction.end();
158158
* });
159159
*/
@@ -175,22 +175,22 @@ export class Snapshot extends EventEmitter {
175175
* @type {?(string|Buffer)}
176176
*/
177177
/**
178-
* Whether or not the transaction has been ended. If true, no further requests
179-
* should be made and the transaction should be discarded.
178+
* Whether or not the transaction has ended. If true, make no further
179+
* requests, and discard the transaction.
180180
*
181181
* @name Snapshot#ended
182182
* @type {boolean}
183183
*/
184184
/**
185-
* The raw transaction response object. Will be populated after
186-
* {@link Snapshot#begin} has been called.
185+
* The raw transaction response object. It is populated after
186+
* {@link Snapshot#begin} is called.
187187
*
188188
* @name Snapshot#metadata
189189
* @type {?TransactionResponse}
190190
*/
191191
/**
192192
* **Snapshot only**
193-
* The timestamp at which all reads will be performed.
193+
* The timestamp at which all reads are performed.
194194
*
195195
* @name Snapshot#readTimestamp
196196
* @type {?external:PreciseDate}
@@ -239,7 +239,7 @@ export class Snapshot extends EventEmitter {
239239
* @param {TransactionResponse} apiResponse The raw transaction object.
240240
*/
241241
/**
242-
* Begin a new transaction. Typically you shouldn't need to call this unless
242+
* Begin a new transaction. Typically, you need not call this unless
243243
* manually creating transactions via {@link Session} objects.
244244
*
245245
* @see [BeginTransaction API Documentation](https://cloud.google.com/spanner/docs/reference/rpc/google.spanner.v1#google.spanner.v1.Spanner.BeginTransaction)
@@ -254,7 +254,7 @@ export class Snapshot extends EventEmitter {
254254
* }
255255
* });
256256
*
257-
* @example <caption>If the callback is omitted, we'll return a Promise
257+
* @example <caption>If the callback is omitted, the function returns a Promise
258258
* </caption>
259259
* transaction.begin()
260260
* .then(function(data) {
@@ -322,7 +322,7 @@ export class Snapshot extends EventEmitter {
322322
* @property {string[]} [keys] The primary keys of the rows in this table to be
323323
* yielded. If using a composite key, provide an array within this array.
324324
* See the example below.
325-
* @property {KeyRange[]} [ranges] An alternative to the keys property, this can
325+
* @property {KeyRange[]} [ranges] An alternative to the keys property; this can
326326
* be used to define a range of keys to be yielded.
327327
* @property {boolean} [json=false] Receive the rows as serialized objects. This
328328
* is the equivalent of calling `toJSON()` on each row.
@@ -405,7 +405,7 @@ export class Snapshot extends EventEmitter {
405405
* });
406406
*
407407
* @example <caption>Alternatively, set `query.json` to `true`, and this step
408-
* will be performed automatically.</caption>
408+
* will perform automatically.</caption>
409409
* transaction.createReadStream('Singers', {
410410
* keys: ['1'],
411411
* columns: ['SingerId', 'name'],
@@ -502,9 +502,9 @@ export class Snapshot extends EventEmitter {
502502
*
503503
* transaction.runUpdate(query, err => {
504504
* if (err) {
505-
* // In the event of an error here there would be nothing to rollback,
505+
* // In the event of an error, there would be nothing to rollback,
506506
* so
507-
* // instead of continuing, we might want to just discard the
507+
* // instead of continuing, discard the
508508
* transaction. transaction.end(); return;
509509
* }
510510
*
@@ -530,7 +530,7 @@ export class Snapshot extends EventEmitter {
530530
* object has a `name` and `value` property. To get a serialized object,
531531
* call `toJSON()`. Optionally, provide an options object to `toJSON()`
532532
* specifying `wrapNumbers: true` to protect large integer values outside
533-
* of the range of JavaScript Number. If set, FLOAT64 values will be returned
533+
* of the range of JavaScript Number. If set, FLOAT64 values are returned
534534
* as {@link Spanner.Float} objects and INT64 values as {@link
535535
* Spanner.Int}.
536536
*/
@@ -541,7 +541,7 @@ export class Snapshot extends EventEmitter {
541541
* object has a `name` and `value` property. To get a serialized object,
542542
* call `toJSON()`. Optionally, provide an options object to `toJSON()`
543543
* specifying `wrapNumbers: true` to protect large integer values outside
544-
* of the range of JavaScript Number. If set, FLOAT64 values will be returned
544+
* of the range of JavaScript Number. If set, FLOAT64 values are returned
545545
* as {@link Spanner.Float} objects and INT64 values as {@link
546546
* Spanner.Int}.
547547
*/
@@ -617,7 +617,7 @@ export class Snapshot extends EventEmitter {
617617
* });
618618
*
619619
* @example <caption>Alternatively, set `query.json` to `true`, and this step
620-
* will be performed automatically.</caption>
620+
* will perform automatically.</caption>
621621
* query.json = true;
622622
*
623623
* transaction.read('Singers', query, function(err, rows) {
@@ -663,10 +663,10 @@ export class Snapshot extends EventEmitter {
663663
* **Performance Considerations:**
664664
*
665665
* This method wraps the streaming method,
666-
* {@link Snapshot#run} for your convenience. All rows will
667-
* be stored in memory before being released to your callback. If you intend
668-
* on receiving a lot of results from your query, consider using the streaming
669-
* method, so you can free each result from memory after consuming it.
666+
* {@link Snapshot#run} for your convenience. All rows are stored in memory
667+
* before releasing to your callback. If you intend to receive a lot of
668+
* results from your query, consider using the streaming method,
669+
* so you can free each result from memory after consuming it.
670670
*
671671
* Wrapper around {@link v1.SpannerClient#executeStreamingSql}.
672672
*
@@ -923,7 +923,7 @@ export class Snapshot extends EventEmitter {
923923
codec.convertMsToProtoTimestamp(options.exactStaleness as number);
924924
}
925925

926-
// if we didn't detect a convenience format, we'll just assume that maybe
926+
// If we didn't detect a convenience format, we'll just assume that
927927
// they passed in a protobuf timestamp.
928928
if (is.empty(readOnly)) {
929929
Object.assign(readOnly, options);
@@ -939,7 +939,7 @@ export class Snapshot extends EventEmitter {
939939
* @private
940940
* @static
941941
*
942-
* @param {ExecuteSqlRequest} request The sql request.
942+
* @param {ExecuteSqlRequest} request The SQL request.
943943
* @returns {object}
944944
*/
945945
static encodeParams(request: ExecuteSqlRequest) {
@@ -976,15 +976,15 @@ export class Snapshot extends EventEmitter {
976976

977977
/*! Developer Documentation
978978
*
979-
* All async methods (except for streams) will return a Promise in the event
979+
* All async methods (except for streams) return a Promise in the event
980980
* that a callback is omitted.
981981
*/
982982
promisifyAll(Snapshot, {
983983
exclude: ['end'],
984984
});
985985

986986
/**
987-
* Dml class should never be used directly. Instead it should be extended upon
987+
* Never use DML class directly. Instead, it should be extended upon
988988
* if a class requires DML capabilities.
989989
*
990990
* @private
@@ -1005,7 +1005,7 @@ export class Dml extends Snapshot {
10051005
* @param {number} rowCount Affected row count.
10061006
*/
10071007
/**
1008-
* Execute a DML statements and get the affected row count.
1008+
* Execute a DML statement and get the affected row count.
10091009
*
10101010
* @private
10111011
*
@@ -1044,7 +1044,7 @@ export class Dml extends Snapshot {
10441044

10451045
/*! Developer Documentation
10461046
*
1047-
* All async methods (except for streams) will return a Promise in the event
1047+
* All async methods (except for streams) return a Promise in the event
10481048
* that a callback is omitted.
10491049
*/
10501050
promisifyAll(Dml);
@@ -1058,14 +1058,14 @@ promisifyAll(Dml);
10581058
* Calling either {@link Transaction#commit} or {@link Transaction#rollback}
10591059
* signals that the transaction is finished and no further requests will be
10601060
* made. If for some reason you decide not to call one of the aformentioned
1061-
* methods, you should call {@link Transaction#end} to release the underlying
1061+
* methods, call {@link Transaction#end} to release the underlying
10621062
* {@link Session}.
10631063
*
10641064
* Running a transaction via {@link Database#runTransaction} or
1065-
* {@link Database#runTransactionAsync} will automatically re-run the
1065+
* {@link Database#runTransactionAsync} automatically re-runs the
10661066
* transaction on `ABORTED` errors.
10671067
*
1068-
* {@link Database#getTransaction} will return a plain {@link Transaction}
1068+
* {@link Database#getTransaction} returns a plain {@link Transaction}
10691069
* object, requiring the user to retry manually.
10701070
*
10711071
* @class
@@ -1110,7 +1110,7 @@ export class Transaction extends Dml {
11101110
* @type {?google.protobuf.Timestamp}
11111111
*/
11121112
/**
1113-
* Execute a DML statements and get the affected row count.
1113+
* Execute a DML statement and get the affected row count.
11141114
*
11151115
* @name Transaction#runUpdate
11161116
*
@@ -1662,7 +1662,7 @@ export class Transaction extends Dml {
16621662

16631663
/*! Developer Documentation
16641664
*
1665-
* All async methods (except for streams) will return a Promise in the event
1665+
* All async methods (except for streams) return a Promise in the event
16661666
* that a callback is omitted.
16671667
*/
16681668
promisifyAll(Transaction, {
@@ -1681,7 +1681,7 @@ promisifyAll(Transaction, {
16811681
* statement over each partition in parallel using separate, internal
16821682
* transactions that commit independently.
16831683
*
1684-
* Chances are you'll never need to create a partitioned dml transaction
1684+
* Chances are, you'll never need to create a partitioned DML transaction
16851685
* directly, instead you'll want to use {@link Database#runPartitionedUpdate}.
16861686
*
16871687
* @class
@@ -1698,7 +1698,7 @@ export class PartitionedDml extends Dml {
16981698
runUpdate(query: string|ExecuteSqlRequest): RunUpdatePromise;
16991699
runUpdate(query: string|ExecuteSqlRequest, callback: RunUpdateCallback): void;
17001700
/**
1701-
* Execute a DML statements and get the affected row count. Unlike
1701+
* Execute a DML statement and get the affected row count. Unlike
17021702
* {@link Transaction#runUpdate} after using this method you should
17031703
* immediately discard this transaction, internally it will invoke
17041704
* {@link PartitionedDml#end}.
@@ -1731,7 +1731,7 @@ export class PartitionedDml extends Dml {
17311731

17321732
/*! Developer Documentation
17331733
*
1734-
* All async methods (except for streams) will return a Promise in the event
1734+
* All async methods (except for streams) return a Promise in the event
17351735
* that a callback is omitted.
17361736
*/
17371737
promisifyAll(PartitionedDml);

0 commit comments

Comments
 (0)