pq: github.com/bmizerany/pq Index | Files

package pq

import "github.com/bmizerany/pq"

Index

Package Files

buf.go conn.go encode.go error.go types.go url.go

Constants

const (
    Efatal   = "FATAL"
    Epanic   = "PANIC"
    Ewarning = "WARNING"
    Enotice  = "NOTICE"
    Edebug   = "DEBUG"
    Einfo    = "INFO"
    Elog     = "LOG"
)

Variables

var (
    ErrSSLNotSupported = errors.New("pq: SSL is not enabled on the server")
    ErrNotSupported    = errors.New("pq: invalid command")
)

func Open

func Open(name string) (_ driver.Conn, err error)

func ParseURL

func ParseURL(url string) (string, error)

ParseURL converts url to a connection string for driver.Open. Example:

"postgres://bob:secret@1.2.3.4:5432/mydb?sslmode=verify-full"

converts to:

"user=bob password=secret host=1.2.3.4 port=5432 dbname=mydb sslmode=verify-full"

A minimal example:

"postgres://"

This will be blank, causing driver.Open to use all of the defaults

type Error

type Error error

type NullTime

type NullTime struct {
    Time  time.Time
    Valid bool // Valid is true if Time is not NULL
}

func (*NullTime) Scan

func (nt *NullTime) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullTime) Value

func (nt NullTime) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type PGError

type PGError interface {
    Error() string
    Fatal() bool
    Get(k byte) (v string)
}

type SimplePGError

type SimplePGError struct {
    // contains filtered or unexported fields
}

func (*SimplePGError) Error

func (err *SimplePGError) Error() string

func (*SimplePGError) Fatal

func (err *SimplePGError) Fatal() bool

func (*SimplePGError) Get

func (err *SimplePGError) Get(k byte) (v string)

type Values

type Values map[string]string

func (Values) Get

func (vs Values) Get(k string) (v string)

func (Values) Set

func (vs Values) Set(k, v string)

Package pq imports 21 packages (graph) and is imported by 72 packages. Updated 2014-01-04. Refresh now. Tools for package owners.