We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 66325e4 commit 8a2b362Copy full SHA for 8a2b362
lib/postgrex.ex
@@ -297,7 +297,7 @@ defmodule Postgrex do
297
"""
298
@spec query(conn, iodata, list, [execute_option]) ::
299
{:ok, Postgrex.Result.t()} | {:error, Exception.t()}
300
- def query(conn, statement, params, opts \\ []) when is_list(params) do
+ def query(conn, statement, params \\ [], opts \\ []) when is_list(params) and is_list(opts) do
301
name = Keyword.get(opts, :cache_statement)
302
303
if comment_not_present!(opts) && name do
@@ -349,7 +349,7 @@ defmodule Postgrex do
349
there was an error. See `query/3`.
350
351
@spec query!(conn, iodata, list, [execute_option]) :: Postgrex.Result.t()
352
- def query!(conn, statement, params, opts \\ []) when is_list(params) do
+ def query!(conn, statement, params \\ [], opts \\ []) when is_list(params) and is_list(opts) do
353
case query(conn, statement, params, opts) do
354
{:ok, result} -> result
355
{:error, err} -> raise err
0 commit comments