Skip to content

Commit

Permalink
Fix syntax of sub_select deprecation notice
Browse files Browse the repository at this point in the history
  • Loading branch information
ulidtko committed Sep 1, 2023
1 parent 80fe41d commit a65e566
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions src/Database/Esqueleto/Internal/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -427,21 +427,19 @@ putLocking clause = Q $ W.tell mempty { sdLockingClause = clause }
tellReturning :: ReturningClause -> SqlQuery ()
tellReturning clause = Q $ W.tell mempty { sdReturningClause = clause }

{-#
DEPRECATED
sub_select
"sub_select \n \
sub_select is an unsafe function to use. If used with a SqlQuery that \n \
returns 0 results, then it may return NULL despite not mentioning Maybe \n \
in the return type. If it returns more than 1 result, then it will throw a \n \
SQL error.\n\n Instead, consider using one of the following alternatives: \n \
- subSelect: attaches a LIMIT 1 and the Maybe return type, totally safe. \n \
- subSelectMaybe: Attaches a LIMIT 1, useful for a query that already \n \
has a Maybe in the return type. \n \
- subSelectCount: Performs a count of the query - this is always safe. \n \
- subSelectUnsafe: Performs no checks or guarantees. Safe to use with \n \
countRows and friends."
#-}
{-# DEPRECATED sub_select
[ "sub_select is an unsafe function to use. If used with a SqlQuery that"
, "returns 0 results, then it may return NULL despite not mentioning Maybe"
, "in the return type. If it returns more than 1 result, then it will throw a"
, "SQL error.\n\n Instead, consider using one of the following alternatives:"
, "- subSelect: attaches a LIMIT 1 and the Maybe return type, totally safe. "
, "- subSelectMaybe: Attaches a LIMIT 1, useful for a query that already"
, " has a Maybe in the return type."
, "- subSelectCount: Performs a count of the query - this is always safe."
, "- subSelectUnsafe: Performs no checks or guarantees. Safe to use with"
, " countRows and friends."
]
#-}
-- | Execute a subquery @SELECT@ in an SqlExpression. Returns a
-- simple value so should be used only when the @SELECT@ query
-- is guaranteed to return just one row.
Expand Down

0 comments on commit a65e566

Please sign in to comment.