mod to sql_subset for generating sql without checks