Or a more general solution is to provide a hook or filter after the db connection is created, but before it is used. This can then be used to set a variable for the connection with the value being the current wordpress user id.
I solved this issue with a patch in wdt_ajax_actions.php (there because I was using wdt native record editing). See the attached screen shot.
The obvious downside is that I’m going to need to reapply this patch with every version update.