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 640e1eca
authored
Apr 26, 2014
by
Joshua Perry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.7 Error on empty result from table definition queries
1 parent
a3aa0824
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletions
lib/query-interface.js
lib/query-interface.js
View file @
640e1ec
...
@@ -369,7 +369,14 @@ module.exports = (function() {
...
@@ -369,7 +369,14 @@ module.exports = (function() {
}
}
self
.
sequelize
.
query
(
sql
,
null
,
{
raw
:
true
}).
success
(
function
(
data
)
{
self
.
sequelize
.
query
(
sql
,
null
,
{
raw
:
true
}).
success
(
function
(
data
)
{
emitter
.
emit
(
'success'
,
data
)
if
(
Utils
.
_
.
isEmpty
(
data
))
{
// If no data is returned from the query, then the table name may be wrong.
// Query generators that use information_schema for retrieving table info will just return an empty result set,
// it will not throw an error like built-ins do (e.g. DESCRIBE on MySql).
emitter
.
emit
(
'error'
,
'No description found for "'
+
tableName
+
'" table. Check the table name and schema; remember, they _are_ case sensitive.'
)
}
else
{
emitter
.
emit
(
'success'
,
data
)
}
}).
error
(
function
(
err
)
{
}).
error
(
function
(
err
)
{
emitter
.
emit
(
'error'
,
err
)
emitter
.
emit
(
'error'
,
err
)
}).
on
(
'sql'
,
function
(
sql
)
{
}).
on
(
'sql'
,
function
(
sql
)
{
...
...
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