Skip to content

Commit 9ffe95d

Browse files
committed
[misc] correction callback documentation links and correct connection.batch return description
1 parent a915ff3 commit 9ffe95d

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

documentation/callback-api.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ You can then uses the Connector in your application code with the Callback API.
2323
console.log(res); // { affectedRows: 1, insertId: 1, warningStatus: 0 }
2424
conn.end();
2525
});
26-
});
26+
});
2727
```
2828

2929

@@ -427,9 +427,7 @@ connection.query("SELECT * FROM mysql.user")
427427
> * `values`: *array* Array of parameter (array of array or array of object if using named placeholders).
428428
> * `callback`: *function* Callback function with arguments (error, results, metadata).
429429
>
430-
> Returns a promise that :
431-
> * resolves with a JSON object.
432-
> * rejects with an [Error](#error).
430+
> callback either return an [[#error|Error]] with results/metadata null or with error empty and results/metadata
433431
434432
Implementation depend of server type and version.
435433
for MariaDB server version 10.2.7+, implementation use dedicated bulk protocol.
@@ -462,20 +460,20 @@ For instance,
462460
463461
## `connection.beginTransaction([callback])`
464462
465-
> * `callback`: *function* Callback function with argument [Error](../README.me#error) if any error.
463+
> * `callback`: *function* Callback function with argument [Error](#error) if any error.
466464
467465
Begins a new transaction.
468466
469467
## `connection.commit([callback])`
470468
471-
> * `callback`: *function* callback function with argument [Error](../README.me##error) if any error.
469+
> * `callback`: *function* callback function with argument [Error](#error) if any error.
472470
473471
Commits the current transaction, if there is one active. The Connector keeps track of the current transaction state on the server. When there isn't an active transaction, this method sends no commands to the server.
474472
475473
476474
## `connection.rollback([callback])`
477475
478-
> * `callback`: *function* Callback function with argument [Error](../README.me##error) if any error.
476+
> * `callback`: *function* Callback function with argument [Error](#error) if any error.
479477
480478
Rolls back the current transaction, if there is one active. The Connector keeps track of the current transaction state on the server. Where there isn't an active transaction, this method sends no commands to the server.
481479
@@ -512,7 +510,7 @@ conn.beginTransaction(err => {
512510
## `connection.changeUser(options[, callback])`
513511
514512
> * `options`: *JSON*, subset of [connection option documentation](#connection-options) = database / charset / password / user
515-
> * `callback`: *function* callback function with argument [Error](../README.me##error) if any error.
513+
> * `callback`: *function* callback function with argument [Error](#error) if any error.
516514
517515
Resets the connection and re-authenticates with the given credentials. This is the equivalent of creating a new connection with a new user, reusing the existing open socket.
518516
@@ -528,7 +526,7 @@ conn.changeUser({user: 'changeUser', password: 'mypassword'}, err => {
528526
529527
## `connection.ping([callback])`
530528
531-
> * `callback`: *function* Callback function with argument [Error](../README.me##error) if any error.
529+
> * `callback`: *function* Callback function with argument [Error](#error) if any error.
532530
533531
Sends a one byte packet to the server to check that the connection is still active.
534532
@@ -544,7 +542,7 @@ conn.ping(err => {
544542
545543
## `connection.end([callback])`
546544
547-
> * `callback`: *function* Callback function with argument [Error](../README.me##error) if any error.
545+
> * `callback`: *function* Callback function with argument [Error](#error) if any error.
548546
549547
Closes the connection gracefully. That is, the Connector waits for current queries to finish their execution then closes the connection.
550548
@@ -556,7 +554,7 @@ conn.end(err => {
556554
557555
## `connection.reset([callback])`
558556
559-
> * `callback`: *function* Callback function with argument [Error](../README.me##error) if any error.
557+
> * `callback`: *function* Callback function with argument [Error](#error) if any error.
560558
561559
reset the connection. Reset will:
562560

0 commit comments

Comments
 (0)