Object to sql generator