Add query generator for audit