Postgrex v0.13.2 Postgrex.ErrorCode

Summary

Functions

Translates a Postgres error code into a name

Translates a Postgres error name into a list of possible codes. Most error names have only a single code, but there are exceptions

Functions

code_to_name(code)
code_to_name(String.t) :: atom | no_return

Translates a Postgres error code into a name

Examples: iex> codetoname("23505") :unique_violation

name_to_code(name)
name_to_code(atom) :: String.t

Translates a Postgres error name into a list of possible codes. Most error names have only a single code, but there are exceptions.

Examples: iex> nametocode(:prohibitedsqlstatement_attempted) "2F003"