Naisheel Verdhan
Naisheel Verdhan

Reputation: 5133

How to use pgp.as.format for a transaction

Is it possible to use pgp.as.format to see raw postgres queries generated by a transaction db.tx(t => ...)? I can't figure out the syntax for this use-case.

Upvotes: 0

Views: 216

Answers (1)

vitaly-t
vitaly-t

Reputation: 25840

If you can't figure out what query is generated, you have the following options:

  • Start using pg-monitor that will show you all the queries automatically
  • Manually connect to event query
  • Use function as.format

Is it possible to use pgp.as.format

Why wouldn't it be possible? The function is there to be used independently whenever needed. But in your case, for viewing generated queries, the other two options are better.

Upvotes: 1

Related Questions