@@ -379,6 +379,9 @@ function Database(cn, dc, config) {
379
379
* - `.message` = `Multiple rows were not expected.`
380
380
* - `.code` = {@link errors.queryResultErrorCode.multiple queryResultErrorCode.multiple}
381
381
*
382
+ * @see
383
+ * {@link Database.oneOrNone }
384
+ *
382
385
* @example
383
386
*
384
387
* // a query with in-line value transformation:
@@ -390,7 +393,7 @@ function Database(cn, dc, config) {
390
393
* @example
391
394
*
392
395
* // a query with in-line value transformation + conversion:
393
- * db.one('SELECT count(*) FROM Users', null , c => +c.count)
396
+ * db.one('SELECT count(*) FROM Users', [] , c => +c.count)
394
397
* .then(count=> {
395
398
* // count = a proper integer value, rather than an object with a string
396
399
* });
@@ -482,7 +485,8 @@ function Database(cn, dc, config) {
482
485
*
483
486
* @see
484
487
* {@link Database.one one },
485
- * {@link Database.none none}
488
+ * {@link Database.none none},
489
+ * {@link Database.manyOrNone manyOrNone}
486
490
*
487
491
* @example
488
492
*
@@ -530,7 +534,10 @@ function Database(cn, dc, config) {
530
534
* The resolved array is extended with hidden property `duration` - number of milliseconds
531
535
* it took the client to execute the query.
532
536
*
533
- * @see {@link Database.any any }
537
+ * @see
538
+ * {@link Database.any any },
539
+ * {@link Database.many many},
540
+ * {@link Database.none none}
534
541
*
535
542
*/
536
543
obj . manyOrNone = function ( query , values ) {
@@ -623,7 +630,7 @@ function Database(cn, dc, config) {
623
630
*
624
631
* // use of value transformation:
625
632
* // deleting rows and returning the number of rows deleted
626
- * db.result('DELETE FROM Events WHERE id = $1', [123], r=> r.rowCount)
633
+ * db.result('DELETE FROM Events WHERE id = $1', [123], r => r.rowCount)
627
634
* .then(data=> {
628
635
* // data = number of rows that were deleted
629
636
* });
@@ -632,7 +639,7 @@ function Database(cn, dc, config) {
632
639
*
633
640
* // use of value transformation:
634
641
* // getting only column details from a table
635
- * db.result('SELECT * FROM Users LIMIT 0', null, r=> r.fields)
642
+ * db.result('SELECT * FROM Users LIMIT 0', null, r => r.fields)
636
643
* .then(data=> {
637
644
* // data = array of column descriptors
638
645
* });
@@ -968,7 +975,6 @@ function Database(cn, dc, config) {
968
975
*
969
976
* // using the regular callback syntax:
970
977
* db.task(t => {
971
- * // t = this
972
978
* // t.ctx = task context object
973
979
*
974
980
* return t.one('SELECT id FROM Users WHERE name = $1', 'John')
@@ -987,7 +993,7 @@ function Database(cn, dc, config) {
987
993
* @example
988
994
*
989
995
* // using the ES6 arrow syntax:
990
- * db.task(t=> {
996
+ * db.task(t => {
991
997
* // t.ctx = task context object
992
998
*
993
999
* return t.one('SELECT id FROM Users WHERE name = $1', 'John')
@@ -1006,8 +1012,7 @@ function Database(cn, dc, config) {
1006
1012
* @example
1007
1013
*
1008
1014
* // using an ES6 generator for the callback:
1009
- * db.task(function*(t) {
1010
- * // t = this
1015
+ * db.task(function * (t) {
1011
1016
* // t.ctx = task context object
1012
1017
*
1013
1018
* let user = yield t.one('SELECT id FROM Users WHERE name = $1', 'John');
@@ -1067,7 +1072,6 @@ function Database(cn, dc, config) {
1067
1072
*
1068
1073
* // using the regular callback syntax:
1069
1074
* db.tx(t => {
1070
- * // t = this
1071
1075
* // t.ctx = transaction context object
1072
1076
*
1073
1077
* return t.one('INSERT INTO Users(name, age) VALUES($1, $2) RETURNING id', ['Mike', 25])
@@ -1108,8 +1112,7 @@ function Database(cn, dc, config) {
1108
1112
* @example
1109
1113
*
1110
1114
* // using an ES6 generator for the callback:
1111
- * db.tx(function*(t) {
1112
- * // t = this
1115
+ * db.tx(function * (t) {
1113
1116
* // t.ctx = transaction context object
1114
1117
*
1115
1118
* let user = yield t.one('INSERT INTO Users(name, age) VALUES($1, $2) RETURNING id', ['Mike', 25]);
0 commit comments