add tableExists helper to Query