Skip to content

Commit ddf4fb5

Browse files
Update explain/4 docs (#456)
1 parent 0392d88 commit ddf4fb5

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

lib/ecto/adapters/sql.ex

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -311,24 +311,27 @@ defmodule Ecto.Adapters.SQL do
311311
312312
Adapter | Supported opts
313313
---------------- | --------------
314-
Postgrex | `analyze`, `verbose`, `costs`, `settings`, `buffers`, `timing`, `summary`
315-
MyXQL | None
314+
Postgrex | `analyze`, `verbose`, `costs`, `settings`, `buffers`, `timing`, `summary`, `format`
315+
MyXQL | `format`
316316
317-
_Postgrex_: Check [PostgreSQL doc](https://www.postgresql.org/docs/current/sql-explain.html)
318-
for version compatibility.
317+
All options except `format` are boolean valued and default to `false`.
319318
320-
Also note that:
319+
The allowed `format` values are `:map`, `:yaml`, and `:text`:
320+
* `:map` is the deserialized JSON encoding.
321+
* `:yaml` and `:text` return the result as a string.
321322
322-
* Currently `:map`, `:yaml`, and `:text` format options are supported
323-
for PostgreSQL. Only `map` and `text` are supported for MyXQL.
324-
* `:map` is the deserialized JSON encoding.
325-
* `:yaml` and `text` return the result as a string;
323+
The built-in adapters support the following formats:
324+
* Postgrex: `:map`, `:yaml` and `:text`
325+
* MyXQL: `:map` and `:text`
326326
327-
* Any other value passed to `opts` will be forwarded to the underlying
328-
adapter query function, including Repo shared options such as `:timeout`;
327+
Any other value passed to `opts` will be forwarded to the underlying adapter query function, including
328+
shared Repo options such as `:timeout`. Non built-in adapters may have specific behaviour and you should
329+
consult their documentation for more details.
329330
330-
* Non built-in adapters may have specific behavior and you should consult
331-
their own documentation.
331+
For version compatiblity, please check your database's documentation:
332+
333+
* _Postgrex_: [PostgreSQL doc](https://www.postgresql.org/docs/current/sql-explain.html).
334+
* _MyXQL_: [MySQL doc](https://dev.mysql.com/doc/refman/8.0/en/explain.html).
332335
333336
"""
334337
@spec explain(pid() | Ecto.Repo.t | Ecto.Adapter.adapter_meta,

0 commit comments

Comments
 (0)