Documentation ¶
Overview ¶
MySQL driver for Go sql package
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDSN = errors.New("Wrong URI") ErrMaxIdle = errors.New("Wrong max idle value") )
Functions ¶
func Register ¶
func Register(query string)
Registers initialisation commands. This is workaround, see http://codereview.appspot.com/5706047
Types ¶
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
func (*Driver) Open ¶
Open new connection. The uri need to have the following syntax:
[tcp://addr/]dbname/user/password[?params] [unix://sockpath/]dbname/user/password[?params]
Params need to have the following syntax:
key1=val1&key2=val2
Key need to have the following value:
charset - used by 'set names' keepalive - send a PING to mysql server after every keepalive seconds.
where protocol spercific part may be empty (this means connection to local server using default protocol). Currently possible forms:
DBNAME/USER/PASSWD?charset=utf8 unix://SOCKPATH/DBNAME/USER/PASSWD tcp://ADDR/DBNAME/USER/PASSWD?maxidle=3600
If a password contains the slashes (/), use a star (*) to repleace it. If a password contains the star (*), use double stars (**) to repleace it.
pass/wd => pass*wd pass*wd => pass**wd
Click to show internal directories.
Click to hide internal directories.