-
Notifications
You must be signed in to change notification settings - Fork 131
Support sequelize connection object (#388) #389
Support sequelize connection object (#388) #389
Conversation
Thank you for the PR Alfredo. The problem with moving away from the connection string for all database adapters is that we now also have to document somewhere how the connection object looks like and where it can be modified since it is not something set up automatically by the generator. Specifically for the problem in #388 and mentioned in feathersjs-ecosystem/feathers-sequelize#229 (comment) and in a discussion in feathersjs/feathers#676 (comment) a encodeURIComponent('my@password') // -> 'my%40password' Would also work. I know it's not super intuitive but connection strings are URIs after all. |
We can scrap this or I can look into getting the generator to ask which format to generate. I don't mind upgrading my nonexistent yeomen-fu. |
A PR generally fancying up the connection setup would be great. Connection strings are definitely not super intuitive but it was the easiest (meaning me = laziest) way since it is just a single string prompt for every db. |
const answers = getProps(current); | ||
const { adapter, database } = answers; | ||
|
||
return adapter === 'sequelize' && database !== 'mssql'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm currently leaving mssql out because I see that it has special handling where the connection string is broken out into components. Let me know if you think it makes sense to refactor that, too,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e.g. force connection object on mssql and fold the sequelize-mssql.js
template into the regular sequelize.js
template.
This looks great, thank you. Sorry I'm taking so long and now I even have to make another request 😑 This repo got moved to a monorepo at /~https://github.com/feathersjs/feathers. Would you mind reopening the pull request there (against /~https://github.com/feathersjs/feathers/tree/master/packages/generator-feathers)? I thought I could just import the new changes again but it does not seem to work. |
No problem. |
Thank you! Closing this then. |
/src/sequelize.js
config/default.json
# make postgres attribute an objectconfig/default.json
isn't molested 👍/src/sequelize.js
Resolves #388