Repository navigation
1.1.0.0
New features
-
You can derive
Rel8ablefor "vanilla" higher-kinded data types - data types that don't use theColumntype family. For example, the following is now possible:data MyTable f = MyTable { myTableX :: f Int32 , myTableY :: f Text } deriving (Generic, Rel8able)
-
The
ProjectableandBiprojectabletype classes have been introduced. These classes model a type of functors and bifunctors (respectively) on tables, where the mapping function is only able to rearrange columns. For example, the following is now possible:x <- project myTableX <$> many ...
-
Insert'sonConflictfield now has a new option -DoUpdate. This maps to PostgreSQL'sON CONFLICT DO UPDATEsyntax, which provides upsert support. (#85) -
Insert,UpdateandDeletehas all been expanded to work withQuerys. In particular:Deletenow supports aUSINGsub-queryUpdatenow supports aFROMsub-queryInsertcan delete the result of any arbitraryQuery(providing the types match)
-
The new
Rel8.Tabulatemodule has been added, which gives aMap-esque interface to writing and composing queries. (#70) -
The new
indexedQuery -> Queryfunction was added. This function augments each row in a query with it's 0-based index. (#117)
Breaking changes
-
Insert,DeleteandUpdatehave all changed. In particular, forInsertusers should now replacerows = xswithrows = values xs. (#85) -
Rename
whereExistsandwhereNotExiststopresentandabsentrespectively. (#57) -
Simplify
evaluateto run directly inside theQuerymonad, rendering theEvaluatemonad unnecessary. (#56) -
The
Labelabletype class has been removed as it's no longer necessary. This class was mostly internal, though was visible in some public API functions. (#76) -
EitherTable,ListTable,MaybeTable,NonEmptyTableandTheseTablenow all have an extra parameter which tracks the context of the table. If you manually specified any types before, you need to provide this parameter - usuallyExprwill be the correct choice. (#101) -
We've done a lot of work to simplify the internals of Rel8, but some of these are breaking changes. However, most of these API changes shouldn't affect users as they are mostly types used in type inference, or affect classes where users don't need to define their own instances.
- The kind of a
Rel8ableis now(Type -> Type) -> Type. Previously it was(X -> Type) -> Type. Tablehas a new associated type -FromExprs. This was previously an open type family.Tablehas a new associated type -Transpose- andRecontextualisehas been renamed toTransposes. ThisTransposesclass now operates in terms ofTranspose.
- The kind of a
-
select,insert,updateanddeletenow produce HasqlStatements, rather than actually running the statement as IO. This allows Rel8 to be used with transaction/connection-managing monads likehasql-transaction. (#94)
Bug fixes
-
Fixes a bug where cartesian products of queries using
catListTable,catNonEmptyTable,catListandcatNonEmptywould incorrectly be zipped instead. (#61) -
Require Opaleye 0.7.3.0. This version has better support for lateral queries, which can improve query plans, especially in
optional/LEFT JOIN(#72) -
Rel8 now compiles with GHC 9. (#97)