fixed type signature for external functions to allow SQL queries in the same (runDB) transaction