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

package pq

import "github.com/bmizerany/pq"


Package Files

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


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


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

func Open Uses

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

func ParseURL Uses

func ParseURL(url string) (string, error)

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


converts to:

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

A minimal example:


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

type Error Uses

type Error error

type NullTime Uses

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

func (*NullTime) Scan Uses

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

Scan implements the Scanner interface.

func (NullTime) Value Uses

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

Value implements the driver Valuer interface.

type PGError Uses

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

type SimplePGError Uses

type SimplePGError struct {
    // contains filtered or unexported fields

func (*SimplePGError) Error Uses

func (err *SimplePGError) Error() string

func (*SimplePGError) Fatal Uses

func (err *SimplePGError) Fatal() bool

func (*SimplePGError) Get Uses

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

type Values Uses

type Values map[string]string

func (Values) Get Uses

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

func (Values) Set Uses

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

Package pq imports 21 packages (graph) and is imported by 190 packages. Updated 2016-07-20. Refresh now. Tools for package owners.