You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In `DBInterface.executemany`, it's much more efficient for databases to
wrap multiple `execute` invocations in transactions, so we add
`transaction` for individual database packages to overload and we need
`getconnection` in order to get the `Connection` for a `Statement`.
Open a transaction against a database connection `conn`, execute a closure `f`,
160
+
then "commit" the transaction after executing the closure function. The default
161
+
definition in DBInterface.jl is a no-op in that it just executes the closure
162
+
function with no transaction. Used in `DBInterface.executemany` to wrap the
163
+
individual execute calls in a transaction since this often leads to much better
164
+
performance in database systems.
165
+
"""
166
+
transaction(f, ::Connection) =f()
167
+
148
168
struct LazyIndex{T} <:AbstractVector{Any}
149
169
x::T
150
170
i::Int
@@ -170,9 +190,11 @@ function executemany(stmt::Statement, params)
170
190
param = params[1]
171
191
len =length(param)
172
192
all(x ->length(x) == len, params) ||throw(ParameterError("parameters provided to `DBInterface.executemany!` do not all have the same number of parameters"))
0 commit comments