This question has been answered by just_nico. See the first response.
Do you use a package or MIGX?
Add package has a prefix parameter https://rtfm.modx.com/xpdo/2.x/class-reference/xpdo/xpdo.addpackage
In MIGX(-manager) you can add your custom prefix in the config.
Otherwise Bob has a method here http://bobsguides.com/blog.html/2014/11/19/using-my-sql-in-modx/