mongo-migrate-ts
mongo-migrate-ts copied to clipboard
chore: Highlight access to client instance and apply 'void | never' as output type for MigrationInterface public methods
- ~Unify arguments and types for MigrationInterface public methods everywhere (doc/template/declare)~
[In README] Highlight access to
client
instance as the second argument for migration methods. - Apply
| never
type for MigrationInterface public methods due to error possibility during execution.
Hey @mycodeself please have a look 🙏
Hey @mycodeself just a gentle reminder, please check this one 🙏
Hey @Mifrill
I've reviewed your changes and while I'm in favor of unifying the <void | never>
types you suggest, I am not so much in favor of passing by default the client
argument even though it is not necessary.
I believe the default basic usage should be kept as simple as possible, that said, I am open to your opinion on this and what motivates you to make these changes.
Thanks for contributing!
Hey @mycodeself thanks for the update.
Regarding:
I am not so much in favor of passing by default the client argument even though it is not necessary.
My main intention was to highlight the access to client
object as a second argument for a migration function (up(db: Db, client: MongoClient)
), because, while looking at up(db: Db)
, to me, it was not quite clear that we have access to client
instance via second argument.
I agree with your concern about keeping it as simple as possible. I suggest keeping migrations files unchanged (up(db: Db)
) but keep the highlighting of that access to the client instance (up(db: Db, client: MongoClient)
) in the README file in all examples, although it mentioned in Transactions section.
Update:
I removed the client
reference in the default template - https://github.com/mycodeself/mongo-migrate-ts/pull/98/commits/6455efb3bd01e0e7cf7f62d8a076a7883e63c449
Hi @mycodeself just another gentle reminder, please have a look 🙏
@Mifrill thanks a lot for your contribution!
:tada: This PR is included in version 1.6.1 :tada:
The release is available on:
Your semantic-release bot :package::rocket: