julia mysql mariadb dbinterface update

https://github.com/JuliaDatabases/DBInterface.jl  mariadb — mysql

while doing a query on “conn”, I opended second connection “conn2”, and updated the table while stepping through the results of the first query

conn = DBInterface.connect(MySQL.Connection,"localhost","user","pass",db="foo")
sql = """select char from foo"""
response = DBInterface.execute(conn,sql)
conn2 = DBInterface.connect(MySQL.Connection,"localhost","user","pass",db="foo")
sql2 = DBInterface.prepare(conn2, "UPDATE foo set agility = ?, bravery = ? where character = ?")
for row in response
    ag=agility(char)
    br=bravery(char)
    DBInterface.execute(sql2, (ag, br, char))
end

julia complains without the parens around the arguments on the DBInterace.execute line.

Leave a Reply