/database-12.jl Secret
Last active
July 5, 2019 03:15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stmt = MySQL.Stmt(con, | |
"INSERT INTO nycflights VALUES (" * | |
join(repeat(["?"], inner = length(names(data)) - 1), ", ") * | |
");" | |
); | |
stmt | |
#> MySQL.Stmt(Ptr{Nothing} @0x00007f80fdb495f0, "INSERT INTO nycflights VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);", 19, 0) | |
@time for i in 1:nrow(data) | |
@info("processing row " * string(i)) | |
MySQL.execute!(stmt, Vector(data[1, names(data)[2:end]])) | |
end | |
# 219.653593 seconds (52.89 M allocations: 3.547 GiB, 0.46% gc time) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment