Add PgError.SQLState method

fixes #15
query-exec-mode
Jack Christensen 2020-01-11 18:23:41 -06:00
parent 70bb7ab6cb
commit b6669ae6dd
1 changed files with 5 additions and 0 deletions

View File

@ -55,6 +55,11 @@ func (pe *PgError) Error() string {
return pe.Severity + ": " + pe.Message + " (SQLSTATE " + pe.Code + ")"
}
// SQLState returns the SQLState of the error.
func (pe *PgError) SQLState() string {
return pe.Code
}
type connectError struct {
config *Config
msg string