Siniyas
Siniyas

Reputation: 471

Getting the sql queries for node pg module

I am working with the pg module for node. I am trying to get some rows from different tables. Often times i get an error in my tests when accessing rows because the query came back empty. In that case i would like to get the query with parameters inserted in the console so i can paste it to pgAdmin and see what is wrong easier.

I tried searching for it in the pg docs but couldnt find anything.

Is there a way to output the queries?

Upvotes: 1

Views: 5280

Answers (1)

Siniyas
Siniyas

Reputation: 471

Thanks to Vitaly's comment and his library pg-promise I was able to print out the statements like described by him in this answer:

get executable query from query with parameters

Thank you Vitaly.

Upvotes: 4

Related Questions