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

allow options to be a JSON object #12404

Merged
merged 8 commits into from
Jun 23, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 13 additions & 1 deletion lib/sequelize.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,20 @@ class Sequelize {

if (options.dialectOptions)
Object.assign(options.dialectOptions, urlParts.query);
else
else
{
yorek marked this conversation as resolved.
Show resolved Hide resolved
options.dialectOptions = urlParts.query;
if (urlParts.query['options']) {
yorek marked this conversation as resolved.
Show resolved Hide resolved
try
{
yorek marked this conversation as resolved.
Show resolved Hide resolved
const o = JSON.parse(urlParts.query['options']);
options.dialectOptions.options = o;
} catch (e) {
// Nothing to do, string is not a valid JSON
// an thus does not need any further processing
}
}
}
}
} else {
// new Sequelize(database, username, password, { ... options })
Expand Down