Hi folks!
We’re happy to announce the release of Rel8 1.7 !
Rel8 is a Haskell library for interacting with PostgreSQL databases, built on top of the fantastic Opaleye library.
The main objectives of Rel8 are:
- Conciseness: Users using Rel8 should not need to write boiler-plate code. By using expressive types, we can provide sufficient information for the compiler to infer code whenever possible.
- Inferrable: Despite using a lot of type level magic, Rel8 aims to have excellent and predictable type inference.
- Familiar: writing Rel8 queries should feel like normal Haskell programming.
If you encounter any issues please let us know.
Here’s the full changelog for this release:
Removed
- Removed support for
network-ip. We still supportiproute.
Added
- Add support for prepared statements. To use prepared statements, simply use
prepare runinstead ofrunwith a function that passes the parameters to your statement. - Added new
Encodertype with three members:binary, which is the Hasql binary encoder,textwhich encodes a type in PostgreSQL’s text format (needed for nested arrays) andquote, which is the does the thing that the function we previously calledencodedoes (i.e.,a -> Opaleye.PrimExpr). - Support hasql-1.9
- Add
elemandelem1toRel8.Arrayfor testing if an element is contained in[]andNonEmptyExprs.
Changed
- Several changes to
TypeInformation:- Changed the
encodefield ofTypeInformationto beEncoder ainstead ofa -> Opaleye.PrimExpr. - Moved the
delimiterfield ofDecoderinto the top level ofTypeInformation, as it’s not “decoding” specific, it’s also used when “encoding”. - Renamed the
parserfield ofDecodertotext, to mirror thetextfield of the newEncodertype.All of this will break any downstream code that uses a completely customDBTypeimplementation, but anything that usesReadShow,Enum,Composite,JSONBEncodedorparseTypeInformationwill continue working as before (which should cover all common cases).
- Changed the
- Stop exporting
DecoderandEncoderfrom theRel8module. These can now be found inRel8.DecoderandRel8.Encoder. - Some changes were made to the
DBEnumtype class:Enumablewas removed as a superclass constraint. It is still used to provide the default implementation of theDBEnumclass.- A new method,
enumerate, was added to theDBEnumclass (with the default implementation provided byEnumable).This is unlikely to break any existingDBEnuminstances, it just allows some instances that weren’t possible before (e.g., for types that are notGeneric).