Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorData ¶
If an error comes from postgres, return as much information as possible for logging purposes.
func Identifier ¶ added in v0.3.0
Identifier quotes an identifier (a name of an object — a table, a column, a function, a type, a schema, etc.) for use in a DDL statement defining or referencing that object. It will return the same identifier if possible, only introducing quotes or modifications when:
- the identifier has an upper-case character
- the identifier has a hyphen
- the identifier is a reserved keyword in PostgreSQL, or is non-reserved but requires quoting in some contexts (when used as a column name, used as a type name, or used as a function name)
For convenience, Identifier allows you to pass the parts of a fully-qualified "dotted" identifier, or a single un-split dotted identifier.
func Literal ¶ added in v0.3.0
Literal quotes a 'literal' (e.g. a parameter, often used to pass literal to DDL and other statements that do not accept parameters) to be used as part of an SQL statement.
Any single quotes in name will be escaped. Any backslashes (i.e. "\") will be replaced by two backslashes (i.e. "\\") and the C-style escape identifier that PostgreSQL provides ('E') will be prepended to the string.
Types ¶
type Error ¶
type Error struct {
Severity string
Code string
Message string
Detail string
Hint string
Position int32
InternalPosition int32
InternalQuery string
Where string
SchemaName string
TableName string
ColumnName string
DataTypeName string
ConstraintName string
File string
Line int32
Routine string
}
pgError represents an error reported by the PostgreSQL server. See http://www.postgresql.org/docs/11/static/protocol-error-fields.html for detailed field description.