Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit f7c25fca
authored
Sep 18, 2014
by
Jan Aagaard Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a note that .set only works for mysql and throw an error for other dialects
1 parent
fa509566
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
lib/sequelize.js
lib/sequelize.js
View file @
f7c25fc
...
...
@@ -564,6 +564,7 @@ module.exports = (function() {
/**
* Execute a query which would set an environment or user variable. The variables are set per connection, so this function needs a transaction.
* Only works for MySQL.
*
* @method set
* @param {Object} variables Object with multiple variables.
...
...
@@ -578,6 +579,9 @@ module.exports = (function() {
// Prepare options
options
=
Utils
.
_
.
extend
({},
this
.
options
.
set
,
typeof
options
===
'object'
&&
options
||
{});
if
([
'mysql'
,
'mariadb'
].
indexOf
(
this
.
options
.
dialect
)
===
-
1
)
{
throw
new
Error
(
'sequelize.set is only supported for mysql'
);
}
if
(
!
options
.
transaction
||
!
(
options
.
transaction
instanceof
Transaction
)
)
{
throw
new
TypeError
(
"options.transaction is required"
);
}
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment