Skip to content

Commit 3199aac

Browse files
deprecate
1 parent a5e5e15 commit 3199aac

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

lib/postgrex.ex

-9
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ defmodule Postgrex do
5252
| {:prepare, :named | :unnamed}
5353
| {:transactions, :strict | :naive}
5454
| {:types, module}
55-
| {:search_path, [String.t()]}
5655
| {:disconnect_on_error_codes, [atom]}
5756
| DBConnection.start_option()
5857

@@ -161,14 +160,6 @@ defmodule Postgrex do
161160
option is only required when using custom encoding or decoding (default:
162161
`Postgrex.DefaultTypes`);
163162
164-
* `:search_path` - A list of strings used to set the search path for the connection.
165-
This is useful when, for instance, an extension like `citext` is installed in a
166-
separate schema. If that schema is not in the connection's search path, Postgrex
167-
might not be able to recognize the extension's data type. When this option is `nil`,
168-
the search path is not modified. (default: `nil`).
169-
See the [PostgreSQL docs](https://www.postgresql.org/docs/current/ddl-schemas.html#DDL-SCHEMAS-PATH)
170-
for more details.
171-
172163
* `:disable_composite_types` - Set to `true` to disable composite types support.
173164
This is useful when using Postgrex against systems that do not support composite types
174165
(default: `false`).

lib/postgrex/protocol.ex

+5
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@ defmodule Postgrex.Protocol do
120120
parameters =
121121
case opts[:search_path] do
122122
path when is_list(path) ->
123+
Logger.warning(
124+
"the `:search_path` option is deprecated. Please use the `:parameters` option by " <>
125+
"passing `:search_path` as a key and a comma delimited string as the value."
126+
)
127+
123128
path = Enum.intersperse(path, ", ")
124129
Keyword.put(parameters, :search_path, path)
125130

0 commit comments

Comments
 (0)