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
不要怂,就是干,撸起袖子干!
You need to sign in or sign up before continuing.
Commit 42706422
authored
Apr 16, 2014
by
Sascha Depold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass the uuid as a second parameter to the sql event
1 parent
cfc66e9e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
7 deletions
lib/dialects/mysql/query.js
lib/dialects/postgres/query.js
lib/dialects/sqlite/query.js
lib/dialects/mysql/query.js
View file @
4270642
...
@@ -24,7 +24,7 @@ module.exports = (function() {
...
@@ -24,7 +24,7 @@ module.exports = (function() {
}
}
this
.
client
.
query
(
this
.
sql
,
function
(
err
,
results
,
fields
)
{
this
.
client
.
query
(
this
.
sql
,
function
(
err
,
results
,
fields
)
{
this
.
emit
(
'sql'
,
this
.
sql
)
this
.
emit
(
'sql'
,
this
.
sql
,
this
.
options
.
uuid
)
if
(
err
)
{
if
(
err
)
{
err
.
sql
=
sql
err
.
sql
=
sql
...
@@ -38,5 +38,3 @@ module.exports = (function() {
...
@@ -38,5 +38,3 @@ module.exports = (function() {
return
Query
return
Query
})()
})()
lib/dialects/postgres/query.js
View file @
4270642
...
@@ -38,12 +38,12 @@ module.exports = (function() {
...
@@ -38,12 +38,12 @@ module.exports = (function() {
query
.
on
(
'error'
,
function
(
err
)
{
query
.
on
(
'error'
,
function
(
err
)
{
receivedError
=
true
receivedError
=
true
err
.
sql
=
sql
err
.
sql
=
sql
self
.
emit
(
'sql'
,
sql
)
self
.
emit
(
'sql'
,
sql
,
self
.
options
.
uuid
)
self
.
emit
(
'error'
,
err
,
self
.
callee
)
self
.
emit
(
'error'
,
err
,
self
.
callee
)
})
})
query
.
on
(
'end'
,
function
(
result
)
{
query
.
on
(
'end'
,
function
(
result
)
{
self
.
emit
(
'sql'
,
self
.
sql
)
self
.
emit
(
'sql'
,
self
.
sql
,
self
.
options
.
uuid
)
if
(
receivedError
)
{
if
(
receivedError
)
{
return
return
...
...
lib/dialects/sqlite/query.js
View file @
4270642
...
@@ -36,13 +36,13 @@ module.exports = (function() {
...
@@ -36,13 +36,13 @@ module.exports = (function() {
if
(
self
.
sql
.
indexOf
(
'-- '
)
===
0
)
{
if
(
self
.
sql
.
indexOf
(
'-- '
)
===
0
)
{
// the sql query starts with a comment. don't bother the server with that ...
// the sql query starts with a comment. don't bother the server with that ...
Utils
.
tick
(
function
()
{
Utils
.
tick
(
function
()
{
self
.
emit
(
'sql'
,
self
.
sql
)
self
.
emit
(
'sql'
,
self
.
sql
,
self
.
options
.
uuid
)
self
.
emit
(
'success'
,
null
)
self
.
emit
(
'success'
,
null
)
})
})
}
else
{
}
else
{
self
.
database
[
getDatabaseMethod
.
call
(
self
)](
self
.
sql
,
function
(
err
,
results
)
{
self
.
database
[
getDatabaseMethod
.
call
(
self
)](
self
.
sql
,
function
(
err
,
results
)
{
// allow clients to listen to sql to do their own logging or whatnot
// allow clients to listen to sql to do their own logging or whatnot
self
.
emit
(
'sql'
,
self
.
sql
)
self
.
emit
(
'sql'
,
self
.
sql
,
self
.
options
.
uuid
)
if
(
err
)
{
if
(
err
)
{
err
.
sql
=
self
.
sql
err
.
sql
=
self
.
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