Skip to content

Commit

Permalink
Update readme/changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
dhensby committed Jan 29, 2022
1 parent b56ee39 commit 0b60855
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.txt
@@ -1,6 +1,7 @@
v8.0.0 (2021-??-??)
v8.0.0 (2022-??-??)
-------------------
[new] Add table.rows.clear() method to allow for chunking updates ([#1094](https://github.com/tediousjs/node-mssql/pull/1094))
[new] Add valueHandler map to store callbacks that are used to process row values ([#1356](https://github.com/tediousjs/node-mssql/pull/1356))
[change] msnodesqlv8 driver detects os platform and attempts to pick correct connections string for it ((#1318)[https://github.com/tediousjs/node-mssql/pull/1318])
[change] Updated to latest Tedious 14 ((#1312)[https://github.com/tediousjs/node-mssql/pull/1312])
[change] Errors for bad bulk load parameters have slightly different error messages ((#1318)[https://github.com/tediousjs/node-mssql/pull/1318])
Expand Down
17 changes: 17 additions & 0 deletions README.md
Expand Up @@ -512,6 +512,23 @@ async function example() {

Similar to the global connection pool, you should aim to only close a pool when you know it will never be needed by the application again. Typically this will only be when your application is shutting down.

### Result value manipulation

In some instances it is desirable to manipulate the record data as it is returned from the database, this may be to cast it as a particular object (eg: `moment` object instead of `Date`) or similar.

In v8.0.0+ it is possible to register per-datatype handlers:

```js
const sql = require('mssql')

// in this example all integer values will return 1 more than their actual value in the database
sql.valueHandler.set(sql.TYPES.Int, (value) => value + 1)

sql.query('SELECT * FROM [example]').then((result) => {
// all `int` columns will return a manipulated value as per the callback above
})
```

## Configuration

The following is an example configuration object:
Expand Down

0 comments on commit 0b60855

Please sign in to comment.