mirandaio
mirandaio

Reputation: 275

How can I set up statementTimeout in Slonik for an individual statement?

I have a query in Slonik that looks like this:

connection.query(sql.unsafe`
  INSERT INTO users (id, foo)
  SELECT *
  FROM ${sql.unnest(rows, ['uuid', 'int4'])}
`);

How can one configure the statement timeout for a particular query using Slonik?

I'm aware that you can configure it when creating the pool:

createPool('postgres://', { statementTimeout: 50000 })

It looks like the documentation implies you can configure it per query but I couldn't find any examples on how to do that.

Upvotes: 0

Views: 31

Answers (0)

Related Questions