@@ -30,7 +30,9 @@ This module extends the popular [`mysql`](https://www.npmjs.com/package/mysql) m
30
30
## Installation
31
31
32
32
``` sh
33
- npm install mysql-plus --save
33
+ npm install mysql-plus
34
+ # or
35
+ yarn add mysql-plus
34
36
```
35
37
36
38
## Usage Example
@@ -142,8 +144,8 @@ an instance, use <a href="#PoolPlus+defineTable"><code>poolPlus.defineTable()</c
142
144
## mysql-plus ⇐ <code >mysql</code >
143
145
This module.
144
146
145
- ** Extends** : <code >mysql</code >
146
- ** See** : [ mysql] ( https://github.com/mysqljs/mysql#mysql )
147
+ ** Extends** : <code >mysql</code >
148
+ ** See** : [ mysql] ( https://github.com/mysqljs/mysql#mysql )
147
149
148
150
* [ mysql-plus] ( #module_mysql-plus ) ⇐ <code >mysql</code >
149
151
* [ ~ ColTypes] ( #module_mysql-plus..ColTypes )
@@ -250,7 +252,7 @@ A function called with the results of a query.
250
252
| results | <code >Array</code > | ; <code >Object</code > | The results of the query. |
251
253
| fields | <code >Array.< ; Object> ; </code > | Information about the returned results' fields (if any). |
252
254
253
- ** See** : [ https://github.com/mysqljs/mysql#performing-queries ] ( https://github.com/mysqljs/mysql#performing-queries )
255
+ ** See** : [ https://github.com/mysqljs/mysql#performing-queries ] ( https://github.com/mysqljs/mysql#performing-queries )
254
256
255
257
---
256
258
@@ -260,8 +262,8 @@ A function called with the results of a query.
260
262
A class that extends the ` mysql ` module's ` Pool ` class with the ability to define tables
261
263
and perform queries and transactions using promises.
262
264
263
- ** Extends** : <code >Pool</code >
264
- ** See** : [ Pool] ( https://github.com/mysqljs/mysql#pooling-connections )
265
+ ** Extends** : <code >Pool</code >
266
+ ** See** : [ Pool] ( https://github.com/mysqljs/mysql#pooling-connections )
265
267
266
268
* [ PoolPlus] ( #PoolPlus ) ⇐ <code >Pool</code >
267
269
* _ instance_
@@ -344,7 +346,7 @@ when it is used as a data-object value or `?` placeholder replacement.
344
346
| :--- | :--- | :--- |
345
347
| sql | <code >string</code > | SQL that should not be escaped. |
346
348
347
- ** Returns** : <code >Object</code > - An object that is turned into the provided ` sql ` string when ` mysql ` attempts to escape it.
349
+ ** Returns** : <code >Object</code > - An object that is turned into the provided ` sql ` string when ` mysql ` attempts to escape it.
348
350
** See** : [ (mysql) Escaping query values] ( https://github.com/mysqljs/mysql#escaping-query-values )
349
351
350
352
** Example** : Inserting a geometry Point
@@ -377,7 +379,7 @@ for querying the table with the given `name`.
377
379
| :--- | :--- | :--- |
378
380
| name | <code >string</code > | The name of the table. |
379
381
380
- ** Returns** : <code >[ MySQLTable] ( #MySQLTable ) </code > - A ` MySQLTable ` instance.
382
+ ** Returns** : <code >[ MySQLTable] ( #MySQLTable ) </code > - A ` MySQLTable ` instance.
381
383
382
384
---
383
385
@@ -393,7 +395,7 @@ Defines a table to be created or updated in the database.
393
395
| schema | <code >Object</code > | An object that defines the table's schema. See the [ Defining Table Schemas] ( #defining-table-schemas ) section. |
394
396
| [ migrationStrategy] | <code >string</code > | One of ` safe ` , ` alter ` , or ` drop ` . This will override the ` migrationStrategy ` value from the [ ` config ` ] ( #module_mysql-plus..createPool ) (but is still subject to the same restrictions in production environments). |
395
397
396
- ** Returns** : <code >[ MySQLTable] ( #MySQLTable ) </code > - A ` MySQLTable ` instance that has methods for performing queries on the table.
398
+ ** Returns** : <code >[ MySQLTable] ( #MySQLTable ) </code > - A ` MySQLTable ` instance that has methods for performing queries on the table.
397
399
** See** : [ Defining Table Schemas] ( #defining-table-schemas )
398
400
399
401
** Example** :
@@ -463,7 +465,7 @@ callback it returns a promise that resolves with the results of the query.
463
465
| [ cb] | <code >[ queryCallback] ( #module_mysql-plus..queryCallback ) </code > | An optional callback that gets called with the results of the query. |
464
466
465
467
** Returns** : <code >?Promise</code > - If the ` cb ` parameter is omitted, a promise that will resolve with the results
466
- of the query is returned.
468
+ of the query is returned.
467
469
** See** : [ https://github.com/mysqljs/mysql#performing-queries ] ( https://github.com/mysqljs/mysql#performing-queries )
468
470
469
471
** Example** :
@@ -549,7 +551,7 @@ A function that will make queries during a transaction.
549
551
If the promise resolves, the transaction will be committed, and if it rejects, the
550
552
transaction will be rolled back. If this function does not return a promise, the
551
553
` done ` callback must be used or else the transaction will not be committed and
552
- the transaction connection will never be released.
554
+ the transaction connection will never be released.
553
555
** See** : [ ` poolPlus.transaction() ` ] ( #PoolPlus+transaction )
554
556
555
557
** Example** : To fail a transaction using the ` done ` callback
@@ -611,7 +613,7 @@ a promise that resolves with the results of the query.
611
613
| [ cb] | <code >[ queryCallback] ( #module_mysql-plus..queryCallback ) </code > | An optional callback that gets called with the results of the query. |
612
614
613
615
** Returns** : <code >?Promise</code > - If the ` cb ` parameter is omitted, a promise that will resolve with the results
614
- of the query is returned.
616
+ of the query is returned.
615
617
** See** : [ https://github.com/mysqljs/mysql#performing-queries ] ( https://github.com/mysqljs/mysql#performing-queries )
616
618
617
619
** Example** :
@@ -635,7 +637,7 @@ A class that provides convenient methods for performing queries.<br>To create
635
637
an instance, use [ ` poolPlus.defineTable() ` ] ( #PoolPlus+defineTable ) or
636
638
[ ` poolPlus.basicTable() ` ] ( #PoolPlus+basicTable ) .
637
639
638
- ** See** : [ https://github.com/mysqljs/mysql#performing-queries ] ( https://github.com/mysqljs/mysql#performing-queries )
640
+ ** See** : [ https://github.com/mysqljs/mysql#performing-queries ] ( https://github.com/mysqljs/mysql#performing-queries )
639
641
640
642
* [ MySQLTable] ( #MySQLTable )
641
643
* [ .name] ( #MySQLTable+name ) : <code >string</code >
@@ -1037,7 +1039,7 @@ Returns a new `MySQLTable` instance that will perform queries using the provided
1037
1039
| trxn | <code >[ Connection] ( #Connection ) </code > | The transaction connection that will be used to perform queries. |
1038
1040
1039
1041
** Returns** : <code >[ MySQLTable] ( #MySQLTable ) </code > - A new ` MySQLTable ` instance that will perform queries using the provided transaction
1040
- connection instead of the ` PoolPlus ` instance that was used to create the original instance.
1042
+ connection instead of the ` PoolPlus ` instance that was used to create the original instance.
1041
1043
** See** : [ ` pool.transaction() ` ] ( #PoolPlus+transaction )
1042
1044
1043
1045
** Example** :
0 commit comments