View definition

func RegisterLocalFile

Defined in github.com/go-sql-driver/mysql/infile.go

Description

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'

filePath := "/home/gopher/data.csv"
mysql.RegisterLocalFile(filePath)
err := db.Exec("LOAD DATA LOCAL INFILE '" + filePath + "' INTO TABLE foo")
if err != nil {
...

RegisterLocalFile is referenced in 2 repositories

github.com/go-sql-driver/mysql github.com/John-Nagle/certscan