Switch to db_select to allow querying revisions