9696function disconnect (; db:: Union{Nothing, Connection} = nothing )
9797if db=== nothing
9898 connection= current_connection ()
99- disconnected= connection. loader. db_disconnect ( connection. conn)
99+ disconnected= Base . invokelatest ( connection. loader. db_disconnect, connection. conn)
100100 current[:connection ]= nothing
101101 disconnected
102102else
103- db. loader. db_disconnect ( db. conn)
103+ Base . invokelatest ( db. loader. db_disconnect, db. conn)
104104end
105105end
106106
@@ -142,7 +142,7 @@ function query(stmt::Structured; db::Connection=current_connection())
142142 a= db. adapter
143143 sql= a. to_sql (stmt)
144144print_debug_sql (db, stmt)
145- db. loader. query ( db. conn, sql)
145+ Base . invokelatest ( db. loader. query, db. conn, sql)
146146end
147147
148148"""
@@ -190,7 +190,7 @@ function query(stmt::Structured, vals::Vector; db::Connection=current_connection
190190 a= db. adapter
191191 prepared= a. to_sql (stmt)
192192print_debug_sql (db, stmt, vals)
193- db. loader. query ( db. conn, prepared, vals)
193+ Base . invokelatest ( db. loader. query, db. conn, prepared, vals)
194194end
195195
196196# ## Repo.query - pk
@@ -312,7 +312,7 @@ function execute(stmt::Structured; db::Connection=current_connection())
312312 a= db. adapter
313313 sql= a. to_sql (stmt)
314314print_debug_sql (db, stmt)
315- db. loader. execute ( db. conn, sql)
315+ Base . invokelatest ( db. loader. execute, db. conn, sql)
316316end
317317
318318"""
@@ -322,7 +322,7 @@ function execute(stmt::Structured, vals::Vector; db::Connection=current_connecti
322322 a= db. adapter
323323 prepared= a. to_sql (stmt)
324324print_debug_sql (db, stmt, vals)
325- db. loader. execute ( db. conn, prepared, vals)
325+ Base . invokelatest ( db. loader. execute, db. conn, prepared, vals)
326326end
327327
328328"""
@@ -332,7 +332,7 @@ function execute(stmt::Structured, nts::Vector{<:NamedTuple}; db::Connection=cur
332332 a= db. adapter
333333 prepared= a. to_sql (stmt)
334334print_debug_sql (db, stmt, nts)
335- db. loader. execute ( db. conn, prepared, nts)
335+ Base . invokelatest ( db. loader. execute, db. conn, prepared, nts)
336336end
337337
338338execute (raw:: Raw ; db:: Connection = current_connection ())= execute ([raw]; db= db)
408408
409409# Repo.execute_result
410410function execute_result (command:: SQLKeyword ; db:: Connection = current_connection ()):: NamedTuple
411- db. loader. execute_result ( db. conn, command)
411+ Base . invokelatest ( db. loader. execute_result, db. conn, command)
412412end
413413
414414