Skip to content

Commit 7285bdb

Browse files
committed
Update readme
1 parent 9856ea2 commit 7285bdb

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ before using this wrapper library.
3030
* The `README.md` file explains how to do this.
3131
- Opening a new database has changed. See `README.md` for example.
3232
- migrations API: `force` is now a `boolean`.
33+
- Can no longer specify a custom `Promise` library. Uses native `Promise` instead.
34+
3335

3436
### [v3.0.3]
3537
> 2019-03-22

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,34 @@ import { open } from 'sqlite'
162162
})()
163163
```
164164

165+
#### Opening multiple databases
166+
167+
```typescript
168+
import sqlite3 from 'sqlite3'
169+
import { open } from 'sqlite'
170+
171+
(async () => {
172+
const [db1, db2] = await Promise.all([
173+
open({
174+
filename: '/tmp/database.db',
175+
driver: sqlite3.Database
176+
}),
177+
open({
178+
filename: '/tmp/database2.db',
179+
driver: sqlite3.Database
180+
}),
181+
])
182+
183+
await db1.migrate({
184+
migrationsPath: '...'
185+
})
186+
187+
await db2.migrate({
188+
migrationsPath: '...'
189+
})
190+
})()
191+
```
192+
165193
#### `open` config params
166194

167195
```typescript

0 commit comments

Comments
 (0)