diff --git a/lib/postgrex/extensions/bit_string.ex b/lib/postgrex/extensions/bit_string.ex index bf06629a..cbe990bb 100644 --- a/lib/postgrex/extensions/bit_string.ex +++ b/lib/postgrex/extensions/bit_string.ex @@ -6,7 +6,7 @@ defmodule Postgrex.Extensions.BitString do def init(opts), do: Keyword.fetch!(opts, :decode_binary) def encode(_) do - quote location: :keep do + quote location: :keep, generated: true do val when is_binary(val) -> [<> | val] diff --git a/lib/postgrex/extensions/box.ex b/lib/postgrex/extensions/box.ex index 64e43622..15a2f8a7 100644 --- a/lib/postgrex/extensions/box.ex +++ b/lib/postgrex/extensions/box.ex @@ -5,7 +5,7 @@ defmodule Postgrex.Extensions.Box do alias Postgrex.Extensions.Point def encode(_) do - quote location: :keep do + quote location: :keep, generated: true do %Postgrex.Box{upper_right: p1, bottom_left: p2} -> encoded_p1 = Point.encode_point(p1, Postgrex.Box) encoded_p2 = Point.encode_point(p2, Postgrex.Box) diff --git a/lib/postgrex/extensions/line_segment.ex b/lib/postgrex/extensions/line_segment.ex index 9b057705..5534b5d3 100644 --- a/lib/postgrex/extensions/line_segment.ex +++ b/lib/postgrex/extensions/line_segment.ex @@ -5,7 +5,7 @@ defmodule Postgrex.Extensions.LineSegment do alias Postgrex.Extensions.Point def encode(_) do - quote location: :keep do + quote location: :keep, generated: true do %Postgrex.LineSegment{point1: p1, point2: p2} -> encoded_p1 = Point.encode_point(p1, Postgrex.LineSegment) encoded_p2 = Point.encode_point(p2, Postgrex.LineSegment) diff --git a/lib/postgrex/extensions/name.ex b/lib/postgrex/extensions/name.ex index 5b73c6b3..7bce9bf9 100644 --- a/lib/postgrex/extensions/name.ex +++ b/lib/postgrex/extensions/name.ex @@ -6,7 +6,7 @@ defmodule Postgrex.Extensions.Name do def init(opts), do: Keyword.fetch!(opts, :decode_binary) def encode(_) do - quote location: :keep do + quote location: :keep, generated: true do name when is_binary(name) and byte_size(name) < 64 -> [<> | name] diff --git a/lib/postgrex/extensions/numeric.ex b/lib/postgrex/extensions/numeric.ex index dec69f7d..f0036a3e 100644 --- a/lib/postgrex/extensions/numeric.ex +++ b/lib/postgrex/extensions/numeric.ex @@ -4,7 +4,7 @@ defmodule Postgrex.Extensions.Numeric do use Postgrex.BinaryExtension, send: "numeric_send" def encode(_) do - quote location: :keep do + quote location: :keep, generated: true do %Decimal{} = decimal -> data = unquote(__MODULE__).encode_numeric(decimal) [<> | data] diff --git a/lib/postgrex/extensions/path.ex b/lib/postgrex/extensions/path.ex index 81e71558..1f95920d 100644 --- a/lib/postgrex/extensions/path.ex +++ b/lib/postgrex/extensions/path.ex @@ -6,7 +6,7 @@ defmodule Postgrex.Extensions.Path do alias Postgrex.Extensions.Point def encode(_) do - quote location: :keep do + quote location: :keep, generated: true do %Postgrex.Path{open: o, points: ps} when is_list(ps) and is_boolean(o) -> open_byte = Path.open_to_byte(o) len = length(ps) diff --git a/lib/postgrex/extensions/polygon.ex b/lib/postgrex/extensions/polygon.ex index 1a240357..c6495688 100644 --- a/lib/postgrex/extensions/polygon.ex +++ b/lib/postgrex/extensions/polygon.ex @@ -6,7 +6,7 @@ defmodule Postgrex.Extensions.Polygon do alias Postgrex.Extensions.Point def encode(_) do - quote location: :keep do + quote location: :keep, generated: true do %Postgrex.Polygon{vertices: vertices} when is_list(vertices) -> len = length(vertices) diff --git a/lib/postgrex/extensions/raw.ex b/lib/postgrex/extensions/raw.ex index a0c30a29..72ce1395 100644 --- a/lib/postgrex/extensions/raw.ex +++ b/lib/postgrex/extensions/raw.ex @@ -15,7 +15,7 @@ defmodule Postgrex.Extensions.Raw do def init(opts), do: Keyword.fetch!(opts, :decode_binary) def encode(_) do - quote location: :keep do + quote location: :keep, generated: true do bin when is_binary(bin) -> [<> | bin] diff --git a/lib/postgrex/extensions/uuid.ex b/lib/postgrex/extensions/uuid.ex index 59fef036..1d34e6a2 100644 --- a/lib/postgrex/extensions/uuid.ex +++ b/lib/postgrex/extensions/uuid.ex @@ -6,7 +6,7 @@ defmodule Postgrex.Extensions.UUID do def init(opts), do: Keyword.fetch!(opts, :decode_binary) def encode(_) do - quote location: :keep do + quote location: :keep, generated: true do uuid when is_binary(uuid) and byte_size(uuid) == 16 -> [<<16::int32>> | uuid] diff --git a/lib/postgrex/type_module.ex b/lib/postgrex/type_module.ex index 6261bc3b..23e7470f 100644 --- a/lib/postgrex/type_module.ex +++ b/lib/postgrex/type_module.ex @@ -333,7 +333,7 @@ defmodule Postgrex.TypeModule do end defp decode_rows(dispatch, rest, acc, rem, full, rows) do - quote location: :keep do + quote location: :keep, generated: true do def decode_rows(binary, types, rows) do decode_rows(binary, byte_size(binary), types, rows) end @@ -464,7 +464,7 @@ defmodule Postgrex.TypeModule do decode_tuple_dispatch(extension, format, rest, oids, n, acc) end - quote do + quote generated: true do def decode_tuple(<>, count, types) when is_integer(count) do decode_tuple(rest, count, types, 0, []) end