(PDB-660) Convert facts query->sql to call qe itself

Signed-off-by: Ken Barber <ken@bob.sh>