Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some unescaped markup in haddocks #316

Merged
merged 4 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/concepts/insert.rst
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ construct the ``DEFAULT`` expression::
.. warning::
Also note PostgreSQL's syntax rules mean that ``DEFAULT``` can only appear
in ``INSERT``` expressions whose rows are specified using ``VALUES``. This
means that the ``rows`` field of your ``Insert`` record doesn't look like
means if that the ``rows`` field of your ``Insert`` record doesn't look like
abigailalice marked this conversation as resolved.
Show resolved Hide resolved
``values [..]``, then ``unsafeDefault`` won't work.


Expand Down
22 changes: 11 additions & 11 deletions src/Rel8.hs
Original file line number Diff line number Diff line change
Expand Up @@ -563,9 +563,9 @@ import Rel8.Window
-- query = do
-- thingExpr <- each thingSchema
-- where_ $
-- deconstructADT @Thing
-- (\employer -> employerName employer ==. lit \"Mary\")
-- (\potato -> grower potato ==. lit \"Mary\")
-- deconstructADT \@Thing
-- (\\employer -> employerName employer ==. lit \"Mary\")
-- (\\potato -> grower potato ==. lit \"Mary\")
-- (lit False) -- Nullary case
-- thingExpr
-- pure thingExpr
Expand Down Expand Up @@ -609,10 +609,10 @@ import Rel8.Window
-- instantiations of 'buildADT' for 'Task':
--
-- @
-- > :t buildADT @Task @\"Pending\"
-- buildADT @Task @\"Pending\" :: ADT Task Expr
-- > :t buildADT @Task @\"Complete\"
-- buildADT @Task @\"Complete\" :: CompletedTask Expr -> ADT Task Expr
-- > :t buildADT \@Task \@\"Pending\"
-- buildADT \@Task \@\"Pending\" :: ADT Task Expr
-- > :t buildADT \@Task @\"Complete\"
-- buildADT \@Task \@\"Complete\" :: CompletedTask Expr -> ADT Task Expr
-- @
--
-- Note that as the "Pending" constructor has no fields, @buildADT
Expand All @@ -635,8 +635,8 @@ import Rel8.Window
-- @
-- > :{
-- showQuery $ values
-- [ buildADT @Task @\"Pending\"
-- , buildADT @Task @\"Complete\" CompletedTask {date = Rel8.Expr.Time.now}
-- [ buildADT \@Task \@\"Pending\"
-- , buildADT \@Task \@\"Complete\" CompletedTask {date = Rel8.Expr.Time.now}
-- ]
-- :}
-- @
Expand Down Expand Up @@ -685,10 +685,10 @@ import Rel8.Window
-- @
-- let
-- pending :: ADT Task Expr
-- pending = constructADT @Task $ \pending _complete -> pending
-- pending = constructADT \@Task $ \\pending _complete -> pending
--
-- complete :: ADT Task Expr
-- complete = constructADT @Task $ \_pending complete -> complete CompletedTask {date = Rel8.Expr.Time.now}
-- complete = constructADT \@Task $ \\_pending complete -> complete CompletedTask {date = Rel8.Expr.Time.now}
-- @
--
-- These values are otherwise identical to the ones we saw above with
Expand Down
5 changes: 5 additions & 0 deletions src/Rel8/Expr/Default.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ import Rel8.Expr.Opaleye ( fromPrimExpr )
-- 3. @DEFAULT@ values can not be transformed. For example, the innocuous Rel8
-- code @unsafeDefault + 1@ will crash, despite type checking.
--
-- Also note, PostgreSQL's syntax rules mean that @DEFAULT@ can only appear in
-- @INSERT@ expressions whose rows are specified using @VALUES@. This means
-- that if the @rows@ field of your 'Rel8.Insert' record doesn\'t look like
-- @values [..]@, then @unsafeDefault@ won't work.
--
-- Given all these caveats, we suggest avoiding the use of default values where
-- possible, instead being explicit. A common scenario where default values are
-- used is with auto-incrementing identifier columns. In this case, we suggest
Expand Down
Loading