mysql – github.com/go-sql-driver/mysql Index | Files

package mysql

import "github.com/go-sql-driver/mysql"

Go MySQL Driver - A MySQL-Driver for Go's database/sql package

Index

Functions

func DeregisterLocalFile

func DeregisterLocalFile(filepath string)

DeregisterLocalFile removes the given filepath from the whitelist.

func DeregisterReaderHandler

func DeregisterReaderHandler(name string)

DeregisterReaderHandler removes the ReaderHandler function with the given name from the registry.

func RegisterLocalFile

func RegisterLocalFile(filepath string)

RegisterLocalFile adds the given file to the file whitelist, so that it can be used by "LOAD DATA LOCAL INFILE <filepath>". Alternatively you can allow the use of all local files with the DSN parameter 'allowAllFiles=true'

func RegisterReaderHandler

func RegisterReaderHandler(name string, handler func() io.Reader)

RegisterReaderHandler registers a handler function which is used to receive a io.Reader. The Reader can be used by "LOAD DATA LOCAL INFILE Reader::<name>". If the handler returns a io.ReadCloser Close() is called when the request is finished.

Types

type MySQLError

type MySQLError struct {
	Number  uint16
	Message string
}

error type which represents a single MySQL error

func (*MySQLError) Error

func (me *MySQLError) Error() string

type MySQLWarnings

type MySQLWarnings []mysqlWarning

error type which represents a group of one or more MySQL warnings

func (MySQLWarnings) Error

func (mws MySQLWarnings) Error() string

type NullTime

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

NullTime represents a time.Time that may be NULL. NullTime implements the Scanner interface so it can be used as a scan destination:

var nt NullTime
err := db.QueryRow("SELECT time FROM foo WHERE id=?", id).Scan(&nt)
...
if nt.Valid {
   // use nt.Time
} else {
   // NULL value
}

This NullTime implementation is not driver-specific

func (*NullTime) Scan

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

Scan implements the Scanner interface. The value type must be time.Time or string / []byte (formatted time-string), otherwise Scan fails.

func (NullTime) Value

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

Value implements the driver Valuer interface.

Source Files

buffer.go connection.go const.go driver.go errors.go infile.go packets.go result.go rows.go statement.go transaction.go utils.go

Version
v1.0.0
Published
May 14, 2013
Platform
linux/amd64
Imports
15 packages
Last checked
now

Tools for package owners.