if you go this route I’d recommend looking at the R database API. lots of data analysis people will be familiar with it, it seems reasonably well thought out and it already relies on a dispatch like system (not multiple but it at least won’t get in your way)