Example #1
0
// CreateConnection returns a connection for running user queries. No DDL.
func CreateConnection(socketPath, dbName string) (*DBConnection, error) {
	info := map[string]interface{}{
		"host":        "localhost",
		"port":        0,
		"unix_socket": socketPath,
		"uname":       "vt_app",
		"pass":        "",
		"dbname":      dbName,
		"charset":     "utf8",
	}
	c, err := mysql.Connect(info)
	return &DBConnection{c}, err
}
Example #2
0
func CreateGenericConnection(info map[string]interface{}) (*DBConnection, error) {
	c, err := mysql.Connect(info)
	return &DBConnection{c}, err
}