package mysql
import "github.com/go-sql-driver/mysql"
Go MySQL Driver - A MySQL-Driver for Go's database/sql package
Index ¶
- func DeregisterLocalFile(filepath string)
- func DeregisterReaderHandler(name string)
- func RegisterLocalFile(filepath string)
- func RegisterReaderHandler(name string, handler func() io.Reader)
- type MySQLError
- type MySQLWarnings
- type NullTime
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 ¶
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 ¶
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 ¶
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 ¶
Scan implements the Scanner interface. The value type must be time.Time or string / []byte (formatted time-string), otherwise Scan fails.
func (NullTime) Value ¶
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.2
- Published
- Jul 11, 2013
- Platform
- darwin/amd64
- Imports
- 15 packages
- Last checked
- now –
Tools for package owners.