Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature(): inside migrations we need to provide Options #2

Open
Stradivario opened this issue Aug 30, 2019 · 0 comments
Open

feature(): inside migrations we need to provide Options #2

Stradivario opened this issue Aug 30, 2019 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@Stradivario
Copy link
Member

Stradivario commented Aug 30, 2019

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

@Stradivario Stradivario changed the title feature(Options): inside migrations we need to provide Options feature(): inside migrations we need to provide Options Aug 30, 2019
@Stradivario Stradivario self-assigned this Sep 16, 2019
@Stradivario Stradivario added the enhancement New feature or request label Sep 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant