mirror of
https://github.com/knex/knex.git
synced 2026-01-05 19:47:55 +00:00
Add ESM example
This commit is contained in:
parent
1d0cff95fd
commit
5269aaad84
11
UPGRADING.md
11
UPGRADING.md
@ -47,10 +47,19 @@ const qb: Knex.QueryBuilder = knex('table').select('*')
|
||||
* IDE autocomplete may stop working if you are using JavaScript (not TypeScript). There are reports for autocomplete still working correctly if knex is used this way:
|
||||
```js
|
||||
const knex = require('knex').knex({
|
||||
//connection parameters
|
||||
//connection parameters
|
||||
});
|
||||
```
|
||||
|
||||
It also works when using ESM imports:
|
||||
```js
|
||||
import { knex } from 'knex'
|
||||
|
||||
const kn = knex({
|
||||
//connection parameters
|
||||
})
|
||||
```
|
||||
|
||||
* Syntax for QueryBuilder augmentation changed. Previously it looked like this:
|
||||
|
||||
```ts
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user