planetscale/database-js

How to specify a timeout

Closed this issue · 2 comments

How do I define a timeout for queries? I want to avoid a potentially long running query

While there is currently no way of supplying a custom timeout, all queries have a timeout of 30 seconds before returning an error. You can read more about our system limitations in our documentation.

I did some more asking around internally and you can also already specify a timeout on SELECT queries using the QUERY_TIMEOUT_MS comment directive. This may be helpful for you if you want to customize timeouts for specific queries.