defmodule Supavisor.Protocol.PgType do
  @moduledoc """
  A module to map PostgreSQL data types to their corresponding Elixir atoms
  """
  def type(type) do
    case type do
      16 -> :booloid
      17 -> :byteaoid
      18 -> :charoid
      19 -> :nameoid
      20 -> :int8oid
      21 -> :int2oid
      22 -> :int2vectoroid
      23 -> :int4oid
      24 -> :regprocoid
      25 -> :textoid
      26 -> :oidoid
      27 -> :tidoid
      28 -> :xidoid
      29 -> :cidoid
      30 -> :oidvectoroid
      114 -> :jsonoid
      3802 -> :jsonboid
      142 -> :xmloid
      194 -> :pgnodetreeoid
      600 -> :pointoid
      601 -> :lsegoid
      602 -> :pathoid
      603 -> :boxoid
      604 -> :polygonoid
      628 -> :lineoid
      651 -> :cidrarrayoid
      700 -> :float4oid
      701 -> :float8oid
      702 -> :abstimeoid
      703 -> :reltimeoid
      704 -> :tintervaloid
      705 -> :unknownoid
      718 -> :circleoid
      790 -> :cashoid
      829 -> :macaddroid
      869 -> :inetoid
      650 -> :cidroid
      1000 -> :boolarrayoid
      1001 -> :byteaarrayoid
      1002 -> :chararrayoid
      1003 -> :namearrayoid
      1005 -> :int2arrayoid
      1006 -> :int2vectorarrayoid
      1007 -> :int4arrayoid
      1008 -> :regprocarrayoid
      1009 -> :textarrayoid
      1010 -> :tidarrayoid
      1011 -> :xidarrayoid
      1012 -> :cidarrayoid
      1013 -> :oidvectorarrayoid
      1014 -> :bpchararrayoid
      1015 -> :varchararrayoid
      1016 -> :int8arrayoid
      1017 -> :pointarrayoid
      1018 -> :lsegarrayoid
      1019 -> :patharrayoid
      1020 -> :boxarrayoid
      1021 -> :float4arrayoid
      1022 -> :float8arrayoid
      1023 -> :abstimearrayoid
      1024 -> :reltimearrayoid
      1025 -> :tintervalarrayoid
      1027 -> :polygonarrayoid
      1028 -> :oidarrayoid
      1033 -> :aclitemoid
      1034 -> :aclitemarrayoid
      1040 -> :macaddrarrayoid
      1041 -> :inetarrayoid
      1042 -> :bpcharoid
      1043 -> :varcharoid
      1082 -> :dateoid
      1083 -> :timeoid
      1114 -> :timestampoid
      1184 -> :timestamptzoid
      1186 -> :intervaloid
      1263 -> :cstringarrayoid
      1266 -> :timetzoid
      1560 -> :bitoid
      1562 -> :varbitoid
      1700 -> :numericoid
      1790 -> :refcursoroid
      2202 -> :regprocedureoid
      2203 -> :regoperoid
      2204 -> :regoperatoroid
      2205 -> :regclassoid
      2206 -> :regtypeoid
      2211 -> :regtypearrayoid
      2950 -> :uuidoid
      2951 -> :uuidarrayoid
      3614 -> :tsvectoroid
      3642 -> :gtsvectoroid
      3615 -> :tsqueryoid
      3734 -> :regconfigoid
      3769 -> :regdictionaryoid
      3904 -> :int4rangeoid
      3926 -> :int8rangeoid
      3906 -> :numrangeoid
      3910 -> :tstzrangeoid
      3908 -> :tsrangeoid
      3912 -> :daterangeoid
      3831 -> :anyrangeoid
      2249 -> :recordoid
      2287 -> :recordarrayoid
      2275 -> :cstringoid
      2276 -> :anyoid
      2277 -> :anyarrayoid
      2278 -> :voidoid
      2279 -> :triggeroid
      2280 -> :language_handleroid
      2281 -> :internaloid
      2282 -> :opaqueoid
      2283 -> :anyelementoid
      2776 -> :anynonarrayoid
      3500 -> :anyenumoid
      3115 -> :fdw_handleroid
      _ -> :undefined
    end
  end
end
