Esempio n. 1
0
func MySQLNewConnection(sock string, user string, password string, database string) (Connection, os.Error) {
	var err os.Error
	var db *mysql.Client
	db, err = mysql.DialUnix(sock, user, password, database)
	if err != nil {
		err = db.Close()
		return nil, err
	}

	conn := new(MySQL)
	conn.Database = database
	conn.db = db
	return conn, err
}