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 33ff3eb2
authored
Sep 30, 2012
by
Sascha Depold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes for mysql 2.0.0-alpha3
1 parent
62c33c23
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
16 deletions
lib/dialects/mysql/connector-manager.js
lib/utils.js
package.json
lib/dialects/mysql/connector-manager.js
View file @
33ff3eb
var
Pooling
=
require
(
'generic-pool'
)
var
mysql
=
require
(
"mysql"
)
,
Pooling
=
require
(
'generic-pool'
)
,
Query
=
require
(
"./query"
)
,
Query
=
require
(
"./query"
)
,
Utils
=
require
(
"../../utils"
)
,
Utils
=
require
(
"../../utils"
)
,
without
=
function
(
arr
,
elem
)
{
return
arr
.
filter
(
function
(
e
)
{
return
e
!=
elem
})
}
,
without
=
function
(
arr
,
elem
)
{
return
arr
.
filter
(
function
(
e
)
{
return
e
!=
elem
})
}
...
@@ -106,18 +107,17 @@ module.exports = (function() {
...
@@ -106,18 +107,17 @@ module.exports = (function() {
}
}
var
connect
=
function
(
done
)
{
var
connect
=
function
(
done
)
{
var
self
=
this
var
connection
=
mysql
.
createConnection
({
var
client
=
require
(
"mysql"
).
createClient
({
host
:
this
.
config
.
host
,
user
:
self
.
config
.
username
,
port
:
this
.
config
.
port
,
password
:
self
.
config
.
password
,
user
:
this
.
config
.
username
,
host
:
self
.
config
.
host
,
password
:
this
.
config
.
password
,
port
:
self
.
config
.
port
,
database
:
this
.
config
.
database
database
:
self
.
config
.
database
})
})
client
.
setMaxListeners
(
self
.
maxConcurrentQueries
)
//
client.setMaxListeners(self.maxConcurrentQueries)
self
.
isConnecting
=
false
this
.
isConnecting
=
false
done
(
null
,
client
)
return
done
(
null
,
connection
)
}
}
var
enqueue
=
function
(
queueItem
)
{
var
enqueue
=
function
(
queueItem
)
{
...
...
lib/utils.js
View file @
33ff3eb
var
client
=
new
(
require
(
"mysql"
).
Client
)()
var
mysql
=
require
(
"mysql"
)
,
connection
=
mysql
.
createConnection
({})
,
util
=
require
(
"util"
)
,
util
=
require
(
"util"
)
,
DataTypes
=
require
(
"./data-types"
)
,
DataTypes
=
require
(
"./data-types"
)
...
@@ -35,13 +36,13 @@ var Utils = module.exports = {
...
@@ -35,13 +36,13 @@ var Utils = module.exports = {
return
s
.
replace
(
"`"
,
""
)
return
s
.
replace
(
"`"
,
""
)
},
},
escape
:
function
(
s
)
{
escape
:
function
(
s
)
{
return
c
lient
.
escape
(
s
).
replace
(
/
\\
"/g
,
'"'
)
return
c
onnection
.
escape
(
s
).
replace
(
/
\\
"/g
,
'"'
)
},
},
format
:
function
(
arr
)
{
format
:
function
(
arr
)
{
var
query
=
arr
[
0
]
var
query
=
arr
[
0
]
,
replacements
=
Utils
.
_
.
compact
(
arr
.
map
(
function
(
obj
)
{
return
obj
!=
query
?
obj
:
null
}))
,
replacements
=
Utils
.
_
.
compact
(
arr
.
map
(
function
(
obj
)
{
return
obj
!=
query
?
obj
:
null
}))
return
c
lient
.
format
.
apply
(
client
,
[
query
,
replacements
])
return
c
onnection
.
format
.
apply
(
connection
,
[
query
,
replacements
])
},
},
isHash
:
function
(
obj
)
{
isHash
:
function
(
obj
)
{
return
Utils
.
_
.
isObject
(
obj
)
&&
!
Utils
.
_
.
isArray
(
obj
);
return
Utils
.
_
.
isObject
(
obj
)
&&
!
Utils
.
_
.
isArray
(
obj
);
...
...
package.json
View file @
33ff3eb
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
}
}
],
],
"dependencies"
:
{
"dependencies"
:
{
"mysql"
:
"
0.9.x
"
,
"mysql"
:
"
~2.0.0-alpha3
"
,
"underscore"
:
"~1.4.0"
,
"underscore"
:
"~1.4.0"
,
"underscore.string"
:
"~2.3.0"
,
"underscore.string"
:
"~2.3.0"
,
"lingo"
:
"~0.0.5"
,
"lingo"
:
"~0.0.5"
,
...
...
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