Skip to content

Commit

Permalink
executable now receiving options to use rethinkdbdash driver
Browse files Browse the repository at this point in the history
  • Loading branch information
vinicius0026 committed Jan 27, 2017
1 parent 55493fe commit e52cb0e
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions bin/rethinkdb-migrate
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ internals.createOptions = {
}

internals.migrateOptions = Object.assign({}, internals.createOptions, {
driver: {
describe: 'Rethinkdb javascript driver. Can be either rethinkdb or rethinkdbdash. Defaults to rethinkdb, the official driver'
},
migrationsTable: {
describe: 'Table where meta information about migrations will be saved. Defaults to _migrations'
},
Expand All @@ -32,7 +35,16 @@ internals.migrateOptions = Object.assign({}, internals.createOptions, {
user: { describe: 'Rethinkdb user', alias: 'u' },
username: { describe: 'Rethinkdb username' },
password: { describe: 'Rethinkdb password', alias: 'p' },
authKey: { describe: 'Rethinkdb authKey' }
authKey: { describe: 'Rethinkdb authKey' },
discovery: {
describe: 'Whether or not the driver should try to keep a list of updated hosts. Only for rethinkdbdash'
},
pool: {
describe: 'Whether or not to use a connection pool when using rethinkdbdash driver. Default to false'
},
cursor: {
describe: 'If true, cursors will not be automatically converted to arrays when using rethinkdbdash. Default to true.'
}
})

require('yargs')
Expand Down Expand Up @@ -108,7 +120,7 @@ function logger (emitter) {
* an option present in the config file and also a environment variable, and so on
*/
function buildOptions (argv) {
const optionsMask = 'name,migrationsDirectory,relativeTo,migrationsTable,host,port,db,user,username,password,authKey'
const optionsMask = 'name,migrationsDirectory,relativeTo,migrationsTable,host,port,db,user,username,password,authKey,driver,discovery,pool,cursor,servers'
const envVars = Mask(process.env, optionsMask)
const file = Mask(readOptionsFile(argv), optionsMask)
const args = Mask(argv, optionsMask)
Expand Down

0 comments on commit e52cb0e

Please sign in to comment.