I've got a query like this in persistent
:
findUserLocation userId =
rawSql [str|SELECT name, ST_Transform(coordinates, 4326)
FROM user
JOIN user_location USING (user_id)
WHERE user.user_id = ?|]
[toPersistValue userId]
I'd like to rewrite this so it doesn't use raw strings, probably into an Esqueleto query, but I want to be sure the end result is equivalent.
Is there a way I can check the SQL my new query will produce without a database connection?
Is there something like SqlPersistM a -> [Text]
? (I've searched, to no avail...)
Or do I have to connect to the DB to verify the query?