parses optional get parameters of a nodejs request url and generates a mysql query