-
Notifications
You must be signed in to change notification settings - Fork 4
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
Change the arguments of syncDiff to the same as Sequelize constructor #1
base: master
Are you sure you want to change the base?
Conversation
Change the arguments of syncDiff to same as Sequelize constructor. Using url affects compatibility as older versions of postgresql does not support. Also, sometimes is troublesome when database user password contain special characters, e.g. '@', '/'...
Pass config objects instead of urls to dbdiff.
Yeah, good idea. But there are two things I would like to discuss: With the tools that I'm used to use I use a lot URLs so I would like to keep compatibility also with URLs. Can you make Also you removed the Thanks for your PR! |
I checked Sequelize constructor source code. I found that it can handle the conversion between URLs and connection config object. Therefore, just get config object from sequelize instance instead of passing-in argument should do the job.
I checked Sequelize constructor source code. I found that it can handle the conversion between URLs and connection config object. About removing P.S. I am currently working on a project where we need a auto migration system (generating sequelize migration compatible js file). We want to avoid the use of |
The test doesn't pass. When I said I wanted to keep support for URLs I meant this:
Both ways should be supported. Probably checking the number of arguments passed to the method.
|
sequelize is currently doing this: if (arguments.length === 1 || (arguments.length === 2 && typeof username === 'object')) {
}` So I think we can pass either url or config object to sequelize constructor first and get config object for db client from |
Yeah, in order to accept your changes |
Using url affects compatibility as older versions of postgresql does not support.
Instead, passing config object should be more compatibility to other nodejs db clients, thus maybe helpful when dbdiff plan to support other database later on.
P.S. Sometimes is troublesome when database user password contain special characters, e.g. '@', '/'...