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 a50100d8
authored
Sep 24, 2013
by
Po-Ying Chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename the option, add test code
1 parent
54ff01f4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
6 deletions
lib/dialects/mysql/connector-manager.js
lib/sequelize.js
test/configuration.test.js
test/support.js
lib/dialects/mysql/connector-manager.js
View file @
a50100d
...
...
@@ -265,9 +265,9 @@ module.exports = (function() {
timezone
:
'Z'
};
if
(
config
.
nodeMysql
)
{
Object
.
keys
(
config
.
nodeMysql
).
forEach
(
function
(
key
)
{
connectionConfig
[
key
]
=
config
.
nodeMysql
[
key
];
if
(
config
.
connectionOptions
)
{
Object
.
keys
(
config
.
connectionOptions
).
forEach
(
function
(
key
)
{
connectionConfig
[
key
]
=
config
.
connectionOptions
[
key
];
});
}
...
...
lib/sequelize.js
View file @
a50100d
...
...
@@ -103,7 +103,8 @@ module.exports = (function() {
native
:
this
.
options
.
native
,
replication
:
this
.
options
.
replication
,
dialectModulePath
:
this
.
options
.
dialectModulePath
,
maxConcurrentQueries
:
this
.
options
.
maxConcurrentQueries
maxConcurrentQueries
:
this
.
options
.
maxConcurrentQueries
,
connectionOptions
:
this
.
options
.
connectionOptions
,
}
try
{
...
...
test/configuration.test.js
View file @
a50100d
...
...
@@ -101,14 +101,23 @@ describe(Support.getTestDialectTeaser("Configuration"), function() {
})
it
(
'should accept four parameters (database, username, password, options)'
,
function
(
done
)
{
var
sequelize
=
new
Sequelize
(
'dbname'
,
'root'
,
'pass'
,
{
port
:
999
})
var
sequelize
=
new
Sequelize
(
'dbname'
,
'root'
,
'pass'
,
{
port
:
999
,
connectionOptions
:
{
supportBigNumbers
:
true
,
bigNumberStrings
:
true
}
})
var
config
=
sequelize
.
config
expect
(
config
.
database
).
to
.
equal
(
'dbname'
)
expect
(
config
.
username
).
to
.
equal
(
'root'
)
expect
(
config
.
password
).
to
.
equal
(
'pass'
)
expect
(
config
.
port
).
to
.
equal
(
999
)
expect
(
config
.
connectionOptions
.
supportBigNumbers
).
to
.
be
.
true
expect
(
config
.
connectionOptions
.
bigNumberStrings
).
to
.
be
.
true
done
()
})
})
})
test/support.js
View file @
a50100d
...
...
@@ -35,7 +35,8 @@ var Support = {
logging
:
options
.
logging
,
dialect
:
options
.
dialect
,
port
:
options
.
port
||
process
.
env
.
SEQ_PORT
||
config
[
options
.
dialect
].
port
,
pool
:
options
.
pool
pool
:
options
.
pool
,
connectionOptions
:
options
.
connectionOptions
||
{}
}
if
(
!!
options
.
host
)
{
...
...
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