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 4d5f7f0e
authored
Dec 14, 2011
by
sdepold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactored show tables handling. it now returns the tableNames instead of objects
1 parent
89c2211d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
lib/connectors/mysql/query.js
lib/connectors/mysql/query.js
View file @
4d5f7f0
...
@@ -61,9 +61,9 @@ module.exports = (function() {
...
@@ -61,9 +61,9 @@ module.exports = (function() {
if
(
this
.
callee
&&
(
this
.
sql
.
indexOf
(
'INSERT INTO'
)
==
0
)
&&
(
results
.
hasOwnProperty
(
'insertId'
)))
if
(
this
.
callee
&&
(
this
.
sql
.
indexOf
(
'INSERT INTO'
)
==
0
)
&&
(
results
.
hasOwnProperty
(
'insertId'
)))
this
.
callee
[
this
.
callee
.
__definition
.
autoIncrementField
]
=
results
.
insertId
this
.
callee
[
this
.
callee
.
__definition
.
autoIncrementField
]
=
results
.
insertId
// transform results into real model instances
// return the first real model instance if options.plain is set (e.g. Model.find)
if
(
this
.
sql
.
indexOf
(
'SELECT'
)
==
0
)
{
if
(
this
.
sql
.
indexOf
(
'SELECT'
)
==
0
)
{
// transform results into real model instances
// return the first real model instance if options.plain is set (e.g. Model.find)
if
(
this
.
options
.
raw
)
{
if
(
this
.
options
.
raw
)
{
result
=
results
result
=
results
}
else
{
}
else
{
...
@@ -74,11 +74,14 @@ module.exports = (function() {
...
@@ -74,11 +74,14 @@ module.exports = (function() {
if
(
this
.
options
.
plain
)
if
(
this
.
options
.
plain
)
result
=
(
result
.
length
==
0
)
?
null
:
result
[
0
]
result
=
(
result
.
length
==
0
)
?
null
:
result
[
0
]
}
else
if
(
this
.
sql
.
indexOf
(
'SHOW'
)
==
0
)
{
result
=
Utils
.
_
.
flatten
(
results
.
map
(
function
(
resultSet
)
{
return
Utils
.
_
.
values
(
resultSet
)
}))
}
else
if
(
this
.
sql
.
indexOf
(
'DESCRIBE'
)
==
0
)
{
result
=
results
}
}
if
((
this
.
sql
.
indexOf
(
'SHOW'
)
==
0
)
||
(
this
.
sql
.
indexOf
(
'DESCRIBE'
)
==
0
))
result
=
results
unbindClient
.
call
(
this
)
unbindClient
.
call
(
this
)
this
.
emit
(
'success'
,
result
)
this
.
emit
(
'success'
,
result
)
}
}
...
...
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