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

Provide documentation about arguments #7

Open
abelosorio opened this issue Apr 25, 2018 · 6 comments
Open

Provide documentation about arguments #7

abelosorio opened this issue Apr 25, 2018 · 6 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@abelosorio
Copy link
Owner

No description provided.

@abelosorio abelosorio added the enhancement New feature or request label Apr 25, 2018
@abelosorio abelosorio added help wanted Extra attention is needed good first issue Good for newcomers labels Jun 4, 2018
@cyrilchapon
Copy link

IMHO, even if your object args is interesting, this library shouldn't integrate its own convention, but rather follow Sequelize.queryInterface convention (args inline instead of wrapped inside an object)

@cyrilchapon
Copy link

Thus, for example, renameEnum should be of form

renameEnum(
  'before',
  'after',
  { transaction: t }
)

@abelosorio
Copy link
Owner Author

Yes, I agree. I think we should find a way for this package to extend Sequelize in a nice way. In other packages I used the Decorator Pattern and I liked it.

Let me know your thoughts.

Thanks

@cyrilchapon
Copy link

cyrilchapon commented Jul 2, 2019

Decorate sequelize with a global decorator factory

const SequelizeEnum = require('sequelize-replace-enum-postgres')

const sequelizeEnum = SequelizeEnum(sequelize)
// Or POO style
// const sequelizeEnum = new SequelizeEnum(sequelize)

sequelizeEnum.replaceEnum('before', 'after', {/* replaceEnumAndSequelizeOptions*/})
sequelizeEnum.dropEnum('before', {/* dropEnumAndSequelizeOptions*/})
// etc...

Curry each call FP style

const sequelizeEnum = require('sequelize-replace-enum-postgres')

sequelizeEnum.replaceEnum(sequelize)('before', 'after', {/* replaceEnumAndSequelizeOptions*/})
sequelizeEnum.dropEnum(sequelize)('before', {/* dropEnumAndSequelizeOptions*/})
// etc...

@abelosorio
Copy link
Owner Author

Hey @cyrilchapon , sorry for the late reply.

What about wrapping the queryInterface? Since all the methods to alter the database's structure are available within queryInterface I think it makes sense to put replaceEnum inside it too.

What do you think?

@cyrilchapon
Copy link

cyrilchapon commented Oct 24, 2022

Partly fixed by #31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants