Add SQL Rewrite support