Skip to content

Commit 5c46f5f

Browse files
better comment
1 parent 5ccc643 commit 5c46f5f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/ecto/adapters/postgres/connection.ex

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2022,9 +2022,10 @@ if Code.ensure_loaded?(Postgrex) do
20222022
defp escape_json(true), do: ["true"]
20232023
defp escape_json(false), do: ["false"]
20242024

2025-
# For unoptimized json_extract_path we allow columns to be
2026-
# a part of the path. To allow this, we use the array[...] syntax
2027-
# which requires special handling for strings and column references
2025+
# To allow columns in json paths, we use the array[...] syntax
2026+
# which requires special handling for strings and column references.
2027+
# We still keep the escape_json/1 variant for strings because it is
2028+
# needed for the queries using @>
20282029
defp escape_json(value, _, _) when is_binary(value) do
20292030
[?', escape_string(value), ?']
20302031
end

0 commit comments

Comments
 (0)