Skip to content

Commit

Permalink
Bump version to 3.5.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
9999years committed Feb 23, 2023
1 parent c312731 commit 5f3c817
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 6 additions & 2 deletions changelog.md
@@ -1,5 +1,9 @@
3.5.9.2
=======
3.5.9.0
========
- @9999years
- #350
- Add `GetFirstTable`, `getTable`, `getTableMaybe` helpers for selecting
tables from `:&` chains
- @josephsumabat
- [#339](https://github.com/bitemyapp/esqueleto/pull/333)
- Add `forUpdateOf`, `forShareOf` locking kinds for postgres
Expand Down
8 changes: 8 additions & 0 deletions src/Database/Esqueleto/Experimental/From/Join.hs
Expand Up @@ -348,8 +348,12 @@ infixl 2 `innerJoin`,
--
-- Note that this typeclass will only select the first table of the given type;
-- it may be less useful if there's multiple tables of the same type.
--
-- @since 3.5.9.0
class GetFirstTable t ts where
-- | Get the first table of type `t` from the tables `ts`.
--
-- @since 3.5.9.0
getFirstTable :: ts -> t

instance GetFirstTable t (t :& ts) where
Expand Down Expand Up @@ -382,12 +386,16 @@ instance {-# OVERLAPPABLE #-} GetFirstTable t ts => GetFirstTable t (ts :& x) wh
--
-- This example is a bit trivial, but once you've joined five or six tables it
-- becomes enormously helpful.
--
-- @since 3.5.9.0
getTable :: forall t ts. GetFirstTable (SqlExpr (Entity t)) ts
=> ts
-> SqlExpr (Entity t)
getTable = getFirstTable

-- | A variant of `getTable` that operates on possibly-null entities.
--
-- @since 3.5.9.0
getTableMaybe :: forall t ts. GetFirstTable (SqlExpr (Maybe (Entity t))) ts
=> ts
-> SqlExpr (Maybe (Entity t))
Expand Down

0 comments on commit 5f3c817

Please sign in to comment.