Skip to content

Commit

Permalink
nah
Browse files Browse the repository at this point in the history
  • Loading branch information
parsonsmatt committed Dec 30, 2024
1 parent 1abf4ce commit c6bde11
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/Database/Esqueleto/Internal/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ sub_select = sub SELECT
subSelect
:: PersistField a
=> SqlQuery (SqlExpr (Value a))
-> SqlExpr (Value (Maybe (Nullable a)))
-> SqlExpr (Value (Maybe a))
subSelect query = just (subSelectUnsafe (query <* limit 1))

-- | Execute a subquery @SELECT@ in a 'SqlExpr'. This function is a shorthand
Expand All @@ -486,7 +486,7 @@ subSelect query = just (subSelectUnsafe (query <* limit 1))
subSelectMaybe
:: PersistField a
=> SqlQuery (SqlExpr (Value (Maybe a)))
-> SqlExpr (Value (Maybe (Nullable a)))
-> SqlExpr (Value (Maybe a))
subSelectMaybe = joinV . subSelect

-- | Performs a @COUNT@ of the given query in a @subSelect@ manner. This is
Expand Down Expand Up @@ -687,9 +687,12 @@ isNothing_ = isNothing
-- how SQL represents @NULL@. That means that @'just' . 'just' = 'just'@.
just
:: SqlExpr (Value typ)
-> SqlExpr (Value (Maybe (Nullable typ)))
-> SqlExpr (Value (Maybe typ))
just = veryUnsafeCoerceSqlExprValue

justNullable :: SqlExpr (Value typ) -> SqlExpr (Value (Maybe (Nullable typ)))
justNullable = veryUnsafeCoerceSqlExprValue

-- | @NULL@ value.
nothing :: SqlExpr (Value (Maybe typ))
nothing = unsafeSqlValue "NULL"
Expand Down Expand Up @@ -958,7 +961,7 @@ coalesce = unsafeSqlFunctionParens "COALESCE"
-- a non-NULL result.
--
-- @since 1.4.3
coalesceDefault :: PersistField a => [SqlExpr (Value (Maybe (Nullable a)))] -> SqlExpr (Value a) -> SqlExpr (Value a)
coalesceDefault :: PersistField a => [SqlExpr (Value (Maybe a))] -> SqlExpr (Value a) -> SqlExpr (Value a)
coalesceDefault exprs = unsafeSqlFunctionParens "COALESCE" . (exprs ++) . return . just

-- | @LOWER@ function.
Expand Down

0 comments on commit c6bde11

Please sign in to comment.