Reputation: 461
I'm new to coffeescript and I'm stuck in a easy problem that I feel ashamed :S ...
How would you pass the variable query
inside the function?
query = 'select * from blabla'
pg.connect conString, (err, client, done) ->
client.query query, (err, result) ->
if err
console.log "error"
else
console.log "success"
done()
Upvotes: 1
Views: 115
Reputation: 461
Found the issue.
The real problem was probably that the name query
was too generic :/
Solved with changing the name of the variable..
theQuery = 'select * from blabla'
pg.connect conString, (err, client, done) ->
client.query theQuery, (err, result) ->
if err
console.log "error"
else
console.log "success"
done()
Upvotes: 1