void_binary.ex (461B)
1 defmodule Postgrex.Extensions.VoidBinary do 2 @moduledoc false 3 import Postgrex.BinaryUtils, warn: false 4 use Postgrex.BinaryExtension, send: "void_send" 5 6 def encode(_) do 7 quote location: :keep do 8 :void -> 9 <<0::int32()>> 10 11 other -> 12 raise DBConnection.EncodeError, Postgrex.Utils.encode_msg(other, "the atom :void") 13 end 14 end 15 16 def decode(_) do 17 quote location: :keep do 18 <<0::int32()>> -> :void 19 end 20 end 21 end