Open mwotton opened 7 years ago
select $ from $ \(jobs,jobUpdates) -> distinctOn [ don (jobUpdates ^. JobUpdateJobId) ] $ do orderBy [ desc (jobUpdates ^. JobUpdateAt) , desc (jobUpdates ^. JobUpdateJobId) ] where_ (jobs ^. JobCompanyId ==. val companyk) where_ (jobUpdates ^. JobUpdateJobId ==. jobs ^. JobId) return jobUpdates
with the error message
uncaught exception: SqlError (SqlError {sqlState = "42P10", sqlExecStatus = FatalError, sqlErrorMsg = "SELECT DISTINCT ON expressions must match initial ORDER BY expressions", sqlErrorDetail = "", sqlErrorHint = ""})
I understand why this is happening, but it'd be really nice if typechecked code producing invalid SQL was less of a regular occurrence in my workflow.
with the error message
I understand why this is happening, but it'd be really nice if typechecked code producing invalid SQL was less of a regular occurrence in my workflow.