Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrDeadConn = errors.New("conn is dead")
var ErrNoRows = errors.New("no rows in result set")
var ErrNotificationTimeout = errors.New("notification timeout")
var ErrTLSRefused = errors.New("server refused TLS connection")
Functions ¶
Types ¶
type CommandTag ¶
type CommandTag string
func (CommandTag) RowsAffected ¶
func (ct CommandTag) RowsAffected() int64
RowsAffected returns the number of rows affected. If the CommandTag was not for a row affecting command (such as "CREATE TABLE") then it returns 0
type Conn ¶
type Conn struct {
Pid int32 // backend pid
SecretKey int32 // key to use to send a cancel query message to the server
RuntimeParams map[string]string // parameters that have been reported by the server
TxStatus byte
// contains filtered or unexported fields
}
Conn is a PostgreSQL connection handle. It is not safe for concurrent usage. Use ConnPool to manage access to multiple database connections from multiple goroutines.
type ConnConfig ¶
type ConnConfig struct {
Host string // host (e.g. localhost) or path to unix domain socket directory (e.g. /private/tmp)
Port uint16 // default: 5432
Database string
User string // default: OS user name
Password string
TLSConfig *tls.Config // config for TLS connection -- nil disables TLS
UseFallbackTLS bool // Try FallbackTLSConfig if connecting with TLSConfig fails. Used for preferring TLS, but allowing unencrypted, or vice-versa
FallbackTLSConfig *tls.Config // config for fallback TLS connection (only used if UseFallBackTLS is true)-- nil disables TLS
}
ConnConfig contains all the options used to establish a connection.
type FieldDescription ¶
type Notification ¶
type PgError ¶
type PgError 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/9.3/static/protocol-error-fields.html for detailed field description.
type ReadBuf ¶
type ReadBuf []byte
ReadBuf byte array helper
type WriteBuf ¶
type WriteBuf struct {
// contains filtered or unexported fields
}
WrifeBuf is used build messages to send to the PostgreSQL server. It is used by the Encoder interface when implementing custom encoders.