3.1.0 • Published 4 years ago
pon-task-db v3.1.0
pon-task-db
DB task set for pon
Installation
$ npm install pon-task-db --save
Usage
'use strict'
const pon = require('pon')
const {setup, seed, dump, migrate} = require('pon-task-db')
async function tryExample () {
const createDB = () => {/*...*/}
const run = pon({
'db:setup': setup(createDB),
'db:seed': seed(createDB, 'db/seeds/:env/*.seed.json')
})
run('db:seed')
}
tryExample()
Signatures
define(options) -> function
Define task
Param | type | Description |
---|---|---|
options | Object | Optional settings |
drop(db, options) -> function
Define task to drop database
Param | type | Description |
---|---|---|
db | function|ClayLump | DB instance or it's creator |
options | Object | Optional settings |
options.unless | string | NODE_ENV to skip |
Param | type | Description |
---|
exec(db, options) -> function
Define task to exec database
Param | type | Description |
---|---|---|
db | function|ClayLump | DB instance or it's creator |
options | Object | Optional settings |
migrate(db, handlers) -> function
Define task
Param | type | Description |
---|---|---|
db | function|ClayLump | DB instance or it's creator |
handlers | Object | Migration handlers |
refresh(db, options) -> function
Define task to refresh database
Param | type | Description |
---|---|---|
db | function|ClayLump | DB instance or it's creator |
options | Object | Optional settings |
setup(db, options) -> function
Define task to setup database
Param | type | Description |
---|---|---|
db | function|ClayLump | DB instance or it's creator |
options | Object | Optional settings |
License
This software is released under the Apache-2.0 License.
Links
3.1.0
4 years ago
3.0.1
4 years ago
3.0.0
4 years ago
2.3.18
5 years ago
2.3.17
6 years ago
2.3.15
6 years ago
2.3.14
6 years ago
2.3.13
6 years ago
2.3.12
6 years ago
2.3.11
6 years ago
2.3.10
6 years ago
2.3.9
6 years ago
2.3.8
6 years ago
2.3.7
7 years ago
2.3.6
7 years ago
2.3.5
7 years ago
2.3.4
7 years ago
2.3.3
7 years ago
2.3.2
7 years ago
2.3.1
7 years ago
2.2.5
7 years ago
2.2.4
7 years ago
2.2.3
7 years ago
2.2.2
7 years ago
2.2.1
7 years ago
2.1.5
7 years ago
2.1.4
7 years ago
2.1.3
7 years ago
2.1.2
7 years ago
2.1.1
7 years ago
2.0.1
7 years ago
1.2.2
7 years ago
1.2.1
7 years ago
1.1.3
7 years ago
1.1.2
7 years ago
1.1.1
7 years ago
1.0.2
7 years ago
1.0.1
7 years ago