bitemyapp / esqueleto

New home of Esqueleto, please file issues so we can get things caught up!
BSD 3-Clause "New" or "Revised" License
376 stars 108 forks source link

Export SqlSelect in public module? #276

Open brandonchinn178 opened 3 years ago

brandonchinn178 commented 3 years ago

If someone needs to write a wrapper around select, they would need to use the SqlSelect constraint. Currently, that class is only exported in an internal module Database.Esqueleto.Internal.Internal, which was moved from Database.Esqueleto.Internal.Sql in 3.5.0.0. It would be great to export this in a public module like Database.Esqueleto so that authors can have a consistent location to import SqlSelect from.

e.g. using my persistent-mtl library, a user would need to write a wrapper like

esqueletoSelect :: (MonadSqlQuery m, E.SqlSelect a r) => E.SqlQuery a -> m [r]
esqueletoSelect q = unsafeLiftSql "esqueleto-select" (E.select q)