Skip to content

Commit

Permalink
Simplify viewFieldBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
belevy committed Oct 19, 2023
1 parent ab00454 commit 1d2fc6d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Database/Esqueleto/Internal/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -590,10 +590,8 @@ ent ^. field
ed = entityDef $ getEntityVal (Proxy :: Proxy (SqlExpr (Entity val)))

viewFieldBuilder :: SqlExpr (Entity val) -> IdentInfo -> FieldDef -> TLB.Builder
viewFieldBuilder (ERaw m f) info fieldDef
| Just alias <- sqlExprMetaAlias m =
fst (f Never info) <> ("." <> useIdent info (aliasedEntityColumnIdent alias fieldDef))
| otherwise = sourceIdent info <> "." <> fieldIdent
viewFieldBuilder (ERaw m f) info fieldDef =
sourceIdent info <> "." <> fieldIdent
where
sourceIdent = fst <$> f Never
fieldIdent
Expand Down

0 comments on commit 1d2fc6d

Please sign in to comment.