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 b0e3dc8d
authored
May 10, 2012
by
Raúl Acuña
Committed by
sdepold
Jun 03, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add logging to postgres dialect
1 parent
77d80a9d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
lib/dialects/postgres/query.js
lib/dialects/postgres/query.js
View file @
b0e3dc8
var
Utils
=
require
(
"../../utils"
)
var
Utils
=
require
(
"../../utils"
)
;
module
.
exports
=
(
function
()
{
module
.
exports
=
(
function
()
{
var
Query
=
function
(
client
,
callee
,
options
)
{
var
Query
=
function
(
client
,
callee
,
options
)
{
...
@@ -7,10 +7,20 @@ module.exports = (function() {
...
@@ -7,10 +7,20 @@ module.exports = (function() {
this
.
client
=
client
this
.
client
=
client
this
.
callee
=
callee
this
.
callee
=
callee
this
.
options
=
Utils
.
_
.
extend
({
this
.
options
=
Utils
.
_
.
extend
({
logging
:
true
,
logging
:
console
.
log
,
plain
:
false
,
plain
:
false
,
raw
:
false
raw
:
false
},
options
||
{})
},
options
||
{})
if
(
this
.
options
.
logging
===
true
)
{
console
.
log
(
'DEPRECATION WARNING: The logging-option should be either a function or false. Default: console.log'
)
this
.
options
.
logging
=
console
.
log
}
if
(
this
.
options
.
logging
==
console
.
log
)
{
// using just console.log will break in node < 0.6
this
.
options
.
logging
=
function
(
s
)
{
console
.
log
(
s
)
}
}
}
}
Utils
.
_
.
extend
(
Query
.
prototype
,
require
(
"../query"
).
prototype
)
Utils
.
_
.
extend
(
Query
.
prototype
,
require
(
"../query"
).
prototype
)
...
@@ -19,6 +29,10 @@ module.exports = (function() {
...
@@ -19,6 +29,10 @@ module.exports = (function() {
this
.
sql
=
sql
this
.
sql
=
sql
if
(
this
.
options
.
logging
!==
false
)
{
this
.
options
.
logging
(
'Executing: '
+
this
.
sql
)
}
var
results
=
[];
var
results
=
[];
var
receivedError
=
false
;
var
receivedError
=
false
;
...
...
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