It should be possible to see the SQL queries generated for specific query sets. This is something that can be useful in order to debug or better understand complex query sets.
In this light, let's introduce a new #to_sql method at the query set level:
User.filter(username: "foo").to_sql
# => "SELECT auth_user.id, auth_user.email, auth_user.username FROM \"users\" WHERE auth_user.username = \"foo\""
Description
It should be possible to see the SQL queries generated for specific query sets. This is something that can be useful in order to debug or better understand complex query sets.
In this light, let's introduce a new
#to_sql
method at the query set level: