Patch a SQL reference in getByUri method