Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UndefVarError: execute not defined #216

Open
kafisatz opened this issue Mar 4, 2024 · 1 comment
Open

UndefVarError: execute not defined #216

kafisatz opened this issue Mar 4, 2024 · 1 comment

Comments

@kafisatz
Copy link
Contributor

kafisatz commented Mar 4, 2024

Recently, MySQL.transaction(conn) do is not working anymore for me.
I am not sure if this is related to DBInterface.jl or MySQL.jl

If I explicitly qualify execute as DBInterface.execute(conn, "START TRANSACTION") in the function definition of transaction things work just fine.

including @quinnj as there were recent changes to transaction

here is an MWE

dbc = (username="admin",db="fortuna",hostname="mill-zur-fs2",pw="some_password")

dr = tempdir()
using Pkg
Pkg.activate(dr)
Pkg.add("MySQL")

using MySQL

conn = MySQL.DBInterface.connect(MySQL.Connection, dbc.hostname, dbc.username,dbc.pw,db=dbc.db)
#dftest001 = DBInterface.execute(conn, "SELECT * FROM testtable limit 3") |> DataFrame

txt = """CREATE TABLE test001 (
  `ab` VARCHAR(45) NULL,
  `cd` INT NULL);
  """

dftest001 = DBInterface.execute(conn, txt) |> DataFrame

MySQL.transaction(conn) do
    rs = """INSERT INTO test001 (ab, cd) VALUES ('ab',1),('axxb',11);""" 
    DBInterface.execute(conn,rs);
end


ERROR: UndefVarError: `execute` not defined
Stacktrace:
 [1] transaction(f::var"#27#28", conn::MySQL.Connection)
   @ MySQL C:\Users\bernhard.konig\.julia\packages\MySQL\pGOcg\src\load.jl:108
 [2] top-level scope
   @ REPL[121]:1

@quinnj
Copy link
Member

quinnj commented Mar 12, 2024

This should have been fixed in the 1.4.5 release; can you double check your version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants