Allow the location query SQL to be modified.

#221