For running J!5.1 you must https://fabrikar.com/forums/index.php?wiki/update-from-github/ or include the new file manually https://fabrikar.com/forums/index.php?threads/joomla-5-1-and-fabrik-cannot-find-files-error.54473/post-285151 See also Announcements
Please see our announcement here.
$my_db = FabrikWorker::getDbo();
$my_query = $my_db->getQuery(true);
$my_query->select('SUM(your_column) AS my_total')->from('your_table');
$my_db->setQuery($my_query);
return $my_db->loadResult();
this assumes your_table is on the default Fabrik database site connection.
-- hugh
From your question I conclude that you have no additional fabrik connection, so this is the default one.How to know is it on the default Fabrik database site connection or not?
This is not Fabrik but PHP and MySQL knowledge
Sorry, I got a bit confused with your different threads pointing to similar issues; the prefilter part was for your prefilter thread.
But I will follow your advice and waste my totally voluntary time giving totally useless answers in other threads.