db: unify FetchOne and FetchRange