Skip to content

Commit

Permalink
[misc] documentation addition for non supported experimental ?? syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
rusher committed Jul 6, 2021
1 parent 9c17990 commit 3374cbb
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions documentation/promise-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,30 @@ DB_PWD=secretPasswrd
```
.env files must NOT be pushed into repository, using .gitignore


### Default options consideration

For new project, enabling option `supportBigInt` is recommended (It will be in a future 3.x version).

This option permits to avoid exact value for big integer (value > 2^53) (see [javascript ES2020
BigInt](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) )

## Consideration for migration from mysql/mysql2

### Experimental `??` syntax
mysql has an experimental syntax permitting the use of `??` characters as placeholder to escape id.
This isn't implemented in mariadb driver, permitting same query syntax for [Connection.query](#connectionquerysql-values---promise) and [Connection.execute](#connectionexecutesql-values--promise) (3.x version).

example:
```js
const res = await conn.query('call ??(?)', [myProc, 'myVal']);
```
has to use explicit escapeId:
```js
const res = await conn.query(`call ${conn.escapeId(myProc)}(?)`, ['myVal']);
```


# Promise API

**Base:**
Expand Down

0 comments on commit 3374cbb

Please sign in to comment.