Configurable restrictive query generator