Skip to content

Commit

Permalink
chore: polishing documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
wellwelwel committed Jul 9, 2023
1 parent 9cb714a commit b65cf6a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 22 deletions.
2 changes: 1 addition & 1 deletion documentation/en/TypeScript-Examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,4 +303,4 @@ You can also check some code examples using **MySQL2** and **TypeScript** to und
- [Extending and using **Interfaces** with `RowDataPacket`, `rowAsArray` and `multipleStatements`](../../examples/typescript/row-data-packet-row-as-array-multi-statements.ts)
- [Checking for `ResultSetHeader`, extending and using **Interfaces** with `RowDataPacket` from `ProcedureCallPacket`](../../examples/typescript/procedure-call-packet.ts)
- [Checking for `ResultSetHeader`, extending and using **Interfaces** with `RowDataPacket` and `rowAsArray` from `ProcedureCallPacket`](../../examples/typescript/procedure-call-packet-row-as-array.ts)
- [Creating a basic custom **MySQL2** **Class**](../../examples/typescript/baisc-custom-class.ts)
- [Creating a basic custom **MySQL2** **Class**](../../examples/typescript/basic-custom-class.ts)
File renamed without changes.
40 changes: 19 additions & 21 deletions examples/typescript/row-data-packet-multi-statements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ import mysql, {
RowDataPacket,
} from 'mysql2/promise';

interface User extends RowDataPacket {
/** id */
0: number;
/** name */
1: string;
}
interface User extends RowDataPacket {
id: number;
name: string;
}

(async () => {
const access: ConnectionOptions = {
Expand Down Expand Up @@ -63,18 +61,18 @@ import mysql, {
})();

/** Output
*
* Inserted: 4
* -----------
* id: 4
* name: Gween
* -----------
* id: 2
* name: John
* -----------
* id: 1
* name: Josh
* -----------
* id: 3
* name: Marie
*/
*
* Inserted: 4
* -----------
* id: 4
* name: Gween
* -----------
* id: 2
* name: John
* -----------
* id: 1
* name: Josh
* -----------
* id: 3
* name: Marie
*/

0 comments on commit b65cf6a

Please sign in to comment.