rxdi/xmigrate

feature(): inside migrations we need to provide Options

Stradivario opened this issue · 0 comments

Options will look as follow:

export const options = {
  runtime: 'before'
}

We can try to create feature to override default First argument inside UP and DOWN functions like this

export const options = {
  async connect() {
    return // returned object will be available inside `up(object)`
  }
}

Full

export const options = {
  async connect() {
    return {db: 'my-db'}
  }
}

export function up(myConnection) {
    console.log(myConnection);
    // { "db":"my-db"}
}

This feature will introduce Detached connection so not only MongoDB can work with Xmigrate