Skip to content

Commit 161ff59

Browse files
bigquery: doc fixes for autoPaginate
1 parent 057695e commit 161ff59

4 files changed

Lines changed: 27 additions & 35 deletions

File tree

packages/bigquery/src/dataset.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,6 @@ Dataset.prototype.delete = function(options, callback) {
357357
* @param {?error} callback.err - An error returned while making this request
358358
* @param {module:bigquery/table[]} callback.tables - The list of tables from
359359
* your Dataset.
360-
* @param {object} callback.apiResponse - The full API response.
361360
*
362361
* @example
363362
* dataset.getTables(function(err, tables) {
@@ -368,16 +367,16 @@ Dataset.prototype.delete = function(options, callback) {
368367
* // To control how many API requests are made and page through the results
369368
* // manually, set `autoPaginate` to `false`.
370369
* //-
371-
* function callback(err, tables, nextQuery, apiResponse) {
370+
* function manualPaginationCallback(err, tables, nextQuery, apiResponse) {
372371
* if (nextQuery) {
373372
* // More results exist.
374-
* dataset.getTables(nextQuery, callback);
373+
* dataset.getTables(nextQuery, manualPaginationCallback);
375374
* }
376375
* }
377376
*
378377
* dataset.getTables({
379378
* autoPaginate: false
380-
* }, callback);
379+
* }, manualPaginationCallback);
381380
*
382381
* //-
383382
* // If the callback is omitted, we'll return a Promise.

packages/bigquery/src/index.js

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,6 @@ BigQuery.prototype.dataset = function(id) {
455455
* @param {?error} callback.err - An error returned while making this request
456456
* @param {module:bigquery/dataset[]} callback.datasets - The list of datasets
457457
* in your project.
458-
* @param {object} callback.apiResponse - The full API response.
459458
*
460459
* @example
461460
* bigquery.getDatasets(function(err, datasets) {
@@ -468,16 +467,16 @@ BigQuery.prototype.dataset = function(id) {
468467
* // To control how many API requests are made and page through the results
469468
* // manually, set `autoPaginate` to `false`.
470469
* //-
471-
* var callback = function(err, datasets, nextQuery, apiResponse) {
470+
* function manualPaginationCallback(err, datasets, nextQuery, apiResponse) {
472471
* if (nextQuery) {
473472
* // More results exist.
474-
* bigquery.getDatasets(nextQuery, callback);
473+
* bigquery.getDatasets(nextQuery, manualPaginationCallback);
475474
* }
476-
* };
475+
* }
477476
*
478477
* bigquery.getDatasets({
479478
* autoPaginate: false
480-
* }, callback);
479+
* }, manualPaginationCallback);
481480
*
482481
* //-
483482
* // If the callback is omitted, we'll return a Promise.
@@ -575,7 +574,6 @@ BigQuery.prototype.getDatasetsStream =
575574
* @param {?error} callback.err - An error returned while making this request
576575
* @param {module:bigquery/job[]} callback.jobs - The list of jobs in your
577576
* project.
578-
* @param {object} callback.apiResponse - The full API response.
579577
*
580578
* @example
581579
* bigquery.getJobs(function(err, jobs) {
@@ -588,16 +586,16 @@ BigQuery.prototype.getDatasetsStream =
588586
* // To control how many API requests are made and page through the results
589587
* // manually, set `autoPaginate` to `false`.
590588
* //-
591-
* var callback = function(err, jobs, nextQuery, apiRespose) {
589+
* function manualPaginationCallback(err, jobs, nextQuery, apiRespose) {
592590
* if (nextQuery) {
593591
* // More results exist.
594-
* bigquery.getJobs(nextQuery, callback);
592+
* bigquery.getJobs(nextQuery, manualPaginationCallback);
595593
* }
596-
* };
594+
* }
597595
*
598596
* bigquery.getJobs({
599597
* autoPaginate: false
600-
* }, callback);
598+
* }, manualPaginationCallback);
601599
*
602600
* //-
603601
* // If the callback is omitted, we'll return a Promise.
@@ -713,14 +711,13 @@ BigQuery.prototype.job = function(id) {
713711
* @param {function} callback - The callback function.
714712
* @param {?error} callback.err - An error returned while making this request
715713
* @param {array} callback.rows - The list of results from your query.
716-
* @param {object} callback.apiResponse - The full API response.
717714
*
718715
* @example
719716
* var query = 'SELECT url FROM [publicdata:samples.github_nested] LIMIT 100';
720717
*
721718
* bigquery.query(query, function(err, rows) {
722719
* if (!err) {
723-
* // Handle results here.
720+
* // rows is an array of results.
724721
* }
725722
* });
726723
*
@@ -737,7 +734,7 @@ BigQuery.prototype.job = function(id) {
737734
* params: [
738735
* 'google'
739736
* ]
740-
* }, callback);
737+
* }, function(err, rows) {});
741738
*
742739
* //-
743740
* // Or if you prefer to name them, that's also supported.
@@ -752,7 +749,7 @@ BigQuery.prototype.job = function(id) {
752749
* params: {
753750
* owner: 'google'
754751
* }
755-
* }, callback);
752+
* }, function(err, rows) {});
756753
*
757754
* //-
758755
* // If you need to use a `DATE`, `DATETIME`, `TIME`, or `TIMESTAMP` type in
@@ -764,16 +761,16 @@ BigQuery.prototype.job = function(id) {
764761
* // To control how many API requests are made and page through the results
765762
* // manually, set `autoPaginate` to `false`.
766763
* //-
767-
* var callback = function(err, rows, nextQuery, apiResponse) {
764+
* function manualPaginationCallback(err, rows, nextQuery, apiResponse) {
768765
* if (nextQuery) {
769-
* bigquery.query(nextQuery, callback);
766+
* bigquery.query(nextQuery, manualPaginationCallback);
770767
* }
771-
* };
768+
* }
772769
*
773770
* bigquery.query({
774771
* query: query,
775772
* autoPaginate: false
776-
* }, callback);
773+
* }, manualPaginationCallback);
777774
*
778775
* //-
779776
* // If the callback is omitted, we'll return a Promise.

packages/bigquery/src/job.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,6 @@ Job.prototype.cancel = function(callback) {
225225
* do not pass a callback.
226226
* @param {?error} callback.err - An error returned while making this request
227227
* @param {array} callback.rows - The results of a job.
228-
* @param {?object} callback.nextQuery - If present, query with this object to
229-
* check for more results.
230-
* @param {object} callback.apiResponse - The full API response.
231228
*
232229
* @example
233230
* //-
@@ -250,16 +247,16 @@ Job.prototype.cancel = function(callback) {
250247
* // To control how many API requests are made and page through the results
251248
* // manually, set `autoPaginate` to `false`.
252249
* //-
253-
* var callback = function(err, rows, nextQuery, apiResponse) {
250+
* function manualPaginationCallback(err, rows, nextQuery, apiResponse) {
254251
* if (nextQuery) {
255252
* // More results exist.
256-
* job.getQueryResults(nextQuery, callback);
253+
* job.getQueryResults(nextQuery, manualPaginationCallback);
257254
* }
258-
* };
255+
* }
259256
*
260257
* job.getQueryResults({
261258
* autoPaginate: false
262-
* }, callback);
259+
* }, manualPaginationCallback);
263260
*
264261
* //-
265262
* // If the callback is omitted, we'll return a Promise.

packages/bigquery/src/table.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -711,29 +711,28 @@ Table.prototype.export = function(destination, options, callback) {
711711
* @param {function} callback - The callback function.
712712
* @param {?error} callback.err - An error returned while making this request
713713
* @param {array} callback.rows - The table data from specified set of rows.
714-
* @param {object} callback.apiResponse - The full API response.
715714
*
716715
* @example
717716
* table.getRows(function(err, rows) {
718717
* if (!err) {
719-
* // Handle results here.
718+
* // rows is an array of results.
720719
* }
721720
* });
722721
*
723722
* //-
724723
* // To control how many API requests are made and page through the results
725724
* // manually, set `autoPaginate` to `false`.
726725
* //-
727-
* var callback = function(err, rows, nextQuery, apiResponse) {
726+
* function manualPaginationCallback(err, rows, nextQuery, apiResponse) {
728727
* if (nextQuery) {
729728
* // More results exist.
730-
* table.getRows(nextQuery, callback);
729+
* table.getRows(nextQuery, manualPaginationCallback);
731730
* }
732-
* };
731+
* }
733732
*
734733
* table.getRows({
735734
* autoPaginate: false
736-
* }, callback);
735+
* }, manualPaginationCallback);
737736
*
738737
* //-
739738
* // If the callback is omitted, we'll return a Promise.

0 commit comments

Comments
 (0)