-
Notifications
You must be signed in to change notification settings - Fork 12
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
Executemany does not work #43
Comments
Same case for SQLite, here's an MWE: using DBInterface, SQLite
db = SQLite.DB()
DBInterface.execute(db, "CREATE TABLE t (x INTEGER, y TEXT)")
stmt = DBInterface.prepare(db, """INSERT INTO t VALUES (:x, :y)""")
DBInterface.executemany(stmt, (x=[1,2,3,4], y=["a", "b", "c", "d"])) This returns: ERROR: MethodError: no method matching getconnection(::SQLite.Stmt)
Stacktrace:
[1] executemany(stmt::SQLite.Stmt, params::NamedTuple{(:x, :y), Tuple{Vector{Int64}, Vector{String}}})
@ DBInterface C:\Users\Jakob\.julia\packages\DBInterface\1Gmxx\src\DBInterface.jl:193
[2] top-level scope
@ REPL[40]:1 |
It's not executemany at fault but the lack of getconnection julia> DBInterface.getconnection(stmt) and according to the source This is a function which should be overrided by the library So it is an ODBC / SQLite problem not DBInterface |
as a workaround, you can define this yourself
although in my case it turned into another problem
and if I changed it to
The insert completed with 1 inserted as a string into the first column but that's something else to find |
I created a PR to fix this missing function |
this has been fixed in SQLite
|
Looks like both cases have been fixed now; thanks all. |
I'm not sure why, but it looks like just a missing implementation of a method?
The text was updated successfully, but these errors were encountered: