Skip to content

Commit 151780d

Browse files
Document :timeout in opts for query/query_many (#450)
I had to do a bit of a dive into Postgrex/DbConnection to see how it propagated, what the default was and whether `:infinity` was allowed.
1 parent e35f3b8 commit 151780d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lib/ecto/adapters/sql.ex

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,8 @@ defmodule Ecto.Adapters.SQL do
234234
end
235235
end
236236

237+
@timeout 15_000
238+
237239
@doc """
238240
Converts the given query to SQL according to its kind and the
239241
adapter in the given repository.
@@ -451,6 +453,7 @@ defmodule Ecto.Adapters.SQL do
451453
## Options
452454
453455
* `:log` - When false, does not log the query
456+
* `:timeout` - Execute request timeout, accepts: `:infinity` (default: `#{@timeout}`);
454457
455458
## Examples
456459
@@ -508,6 +511,7 @@ defmodule Ecto.Adapters.SQL do
508511
## Options
509512
510513
* `:log` - When false, does not log the query
514+
* `:timeout` - Execute request timeout, accepts: `:infinity` (default: `#{@timeout}`);
511515
512516
## Examples
513517

0 commit comments

Comments
 (0)