Skip to content
Open
Show file tree
Hide file tree
Changes from all 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 .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ jobs:
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'

- run: nix build .#devShells.x86_64-linux.default --print-build-logs
- run: nix build .#checks.x86_64-linux.tests --print-build-logs
- run: nix flake check --print-build-logs
82 changes: 0 additions & 82 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,86 +1,4 @@

<a id='changelog-1.7.0.0'></a>
# 1.7.0.0 — 2025-07-31

## Removed

- Removed support for `network-ip`. We still support `iproute`.

## Added

- Add support for prepared statements. To use prepared statements, simply use `prepare run` instead of `run` with a function that passes the parameters to your statement.

- Added new `Encoder` type with three members: `binary`, which is the Hasql binary encoder, `text` which encodes a type in PostgreSQL's text format (needed for nested arrays) and `quote`, which is the does the thing that the function we previously called `encode` does (i.e., `a -> Opaleye.PrimExpr`).

- Add `elem` and `elem1` to `Rel8.Array` for testing if an element is contained in `[]` and `NonEmpty` `Expr`s.

- Support hasql-1.9

- Support GHC-9.12

## Changed

- Several changes to `TypeInformation`:

* Changed the `encode` field of `TypeInformation` to be `Encoder a` instead of `a -> Opaleye.PrimExpr`.

* Moved the `delimiter` field of `Decoder` into the top level of `TypeInformation`, as it's not "decoding" specific, it's also used when "encoding".

* Renamed the `parser` field of `Decoder` to `text`, to mirror the `text` field of the new `Encoder` type.

All of this will break any downstream code that uses a completely custom `DBType` implementation, but anything that uses `ReadShow`, `Enum`, `Composite`, `JSONBEncoded` or `parseTypeInformation` will continue working as before (which should cover all common cases).

- Stop exporting `Decoder` and `Encoder` from the `Rel8` module. These can now be found in `Rel8.Decoder` and `Rel8.Encoder`.

- Some changes were made to the `DBEnum` type class:

* `Enumable` was removed as a superclass constraint. It is still used to provide the default implementation of the `DBEnum` class.
* A new method, `enumerate`, was added to the `DBEnum` class (with the default implementation provided by `Enumable`).

This is unlikely to break any existing `DBEnum` instances, it just allows some instances that weren't possible before (e.g., for types that are not `Generic`).

<a id='changelog-1.6.0.0'></a>
# 1.6.0.0 — 2024-12-13

## Removed

- Remove `Table Expr b` constraint from `materialize`. ([#334](https://github.com/circuithub/rel8/pull/334))

## Added

- Support GHC-9.10. ([#340](https://github.com/circuithub/rel8/pull/340))

- Support hasql-1.8 ([#345](https://github.com/circuithub/rel8/pull/345))

- Add `aggregateJustTable`, `aggregateJustTable` aggregator functions. These provide another way to do aggregation of `MaybeTable`s than the existing `aggregateMaybeTable` function. ([#333](https://github.com/circuithub/rel8/pull/333))

- Add `aggregateLeftTable`, `aggregateLeftTable1`, `aggregateRightTable` and `aggregateRightTable1` aggregator functions. These provide another way to do aggregation of `EitherTable`s than the existing `aggregateEitherTable` function. ([#333](https://github.com/circuithub/rel8/pull/333))

- Add `aggregateThisTable`, `aggregateThisTable1`, `aggregateThatTable`, `aggregateThatTable1`, `aggregateThoseTable`, `aggregateThoseTable1`, `aggregateHereTable`, `aggregateHereTable1`, `aggregateThereTable` and `aggregateThereTable1` aggregation functions. These provide another way to do aggregation of `TheseTable`s than the existing `aggregateTheseTable` function. ([#333](https://github.com/circuithub/rel8/pull/333))

- Add `rawFunction`, `rawBinaryOperator`, `rawAggregateFunction`, `unsafeCoerceExpr`, `unsafePrimExpr`, `unsafeSubscript`, `unsafeSubscripts` — these give more options for generating SQL expressions that Rel8 does not support natively. ([#331](https://github.com/circuithub/rel8/pull/331))

- Expose `unsafeUnnullify` and `unsafeUnnullifyTable` from `Rel8`. ([#343](https://github.com/circuithub/rel8/pull/343))

- Expose `listOf` and `nonEmptyOf`. ([#330](https://github.com/circuithub/rel8/pull/330))

- Add `NOINLINE` pragmas to `Generic` derived default methods of `Rel8able`. This should speed up
compilation times. If users wish for these methods to be `INLINE`d, they can override with a
pragma in their own code. ([#346](https://github.com/circuithub/rel8/pull/346))

## Fixed

- `JSONEncoded` should be encoded as `json` not `jsonb`. ([#347](https://github.com/circuithub/rel8/pull/347))

- Disallow NULL characters in Hedgehog generated text values. ([#339](https://github.com/circuithub/rel8/pull/339))

- Fix fromRational bug. ([#338](https://github.com/circuithub/rel8/pull/338))

- Fix regex match operator. ([#336](https://github.com/circuithub/rel8/pull/336))

- Fix some documentation formatting issues. ([#332](https://github.com/circuithub/rel8/pull/332)), ([#329](https://github.com/circuithub/rel8/pull/329)), ([#327](https://github.com/circuithub/rel8/pull/327)), and ([#318](https://github.com/circuithub/rel8/pull/318))


<a id='changelog-1.5.0.0'></a>
# 1.5.0.0 — 2024-03-19

Expand Down
8 changes: 1 addition & 7 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
packages: .

source-repository-package
type: git
location: https://github.com/jfischoff/tmp-postgres
tag: 7f2467a6d6d5f6db7eed59919a6773fe006cf22b

constraints: ansi-wl-pprint < 1.0.0
allow-newer: base16:base, base16:deepseq, base16:text
allow-newer: *:base, *:template-haskell, *:ghc-prim
5 changes: 0 additions & 5 deletions cabal.project.haskell-nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,3 @@
-- will interpret them as local packages, and try to build them when we cabal
-- build. The only reason we have to specify these is for Haskell.nix to know to
-- override these packages by fetching them rather than using Hackage.

-- Workaround a build failure until the fix mentioned in https://github.com/NixOS/nixpkgs/issues/370138
-- is merged to nixpkgs-unstable
package postgresql-libpq
flags: +use-pkg-config
3 changes: 3 additions & 0 deletions changelog.d/20231009_170238_shane.obrien_aggregateFunction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Added

- `aggregationFunction`, which allows custom aggregation functions to be used.
3 changes: 3 additions & 0 deletions changelog.d/20231009_170616_shane.obrien_mode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Added

- Add support for ordered-set aggregation functions, including `mode`, `percentile`, `percentileContinuous`, `hypotheticalRank`, `hypotheticalDenseRank`, `hypotheticalPercentRank` and `hypotheticalCumeDist`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Added

- Add `aggregateJustTable`, `aggregateJustTable` aggregator functions. These provide another way to do aggregation of `MaybeTable`s than the existing `aggregateMaybeTable` function.
- Add `aggregateLeftTable`, `aggregateLeftTable1`, `aggregateRightTable` and `aggregateRightTable1` aggregator functions. These provide another way to do aggregation of `EitherTable`s than the existing `aggregateEitherTable` function.
- Add `aggregateThisTable`, `aggregateThisTable1`, `aggregateThatTable`, `aggregateThatTable1`, `aggregateThoseTable`, `aggregateThoseTable1`, `aggregateHereTable`, `aggregateHereTable1`, `aggregateThereTable` and `aggregateThereTable1` aggregation functions. These provide another way to do aggregation of `TheseTable`s than the existing `aggregateTheseTable` function.
4 changes: 4 additions & 0 deletions changelog.d/20240701_173914_shane.obrien_raw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Added

- `rawFunction`, `rawBinaryOperator`, `rawAggregateFunction`, `unsafeCoerceExpr`, `unsafePrimExpr`, `unsafeSubscript`, `unsafeSubscripts` — these give more options for generating SQL expressions that Rel8 does not support natively.

3 changes: 3 additions & 0 deletions changelog.d/20240822_184927_teofilcamarasu_ghc_9_10.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Added

- Support GHC 9.10
3 changes: 3 additions & 0 deletions changelog.d/20240918_124205_shane.obrien.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Added

- Expose `unsafeUnnullify` and `unsafeUnnullifyTable` from `Rel8`.
4 changes: 4 additions & 0 deletions changelog.d/20241008_181955_teofilcamarasu_hasql_1_8.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Added

- Support hasql-1.8

5 changes: 5 additions & 0 deletions changelog.d/20241018_112157_teofilcamarasu_try_noinline.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Added

- Add `NOINLINE` pragmas to `Generic` derived default methods of `Rel8able`. This should speed up
compilation times. If users wish for these methods to be `INLINE`d, they can override with a
pragma in their own code.
3 changes: 3 additions & 0 deletions changelog.d/20241018_113208_teofilcamarasu_jsonb.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Fixed

- `JSONEncoded` should be encoded as `json` not `jsonb`. Resolves #344

This file was deleted.

9 changes: 0 additions & 9 deletions changelog.d/20251030_125129_shane.obrien_OnConflict.md

This file was deleted.

3 changes: 0 additions & 3 deletions changelog.d/20260322_223524_shane.obrien_range.md

This file was deleted.

3 changes: 3 additions & 0 deletions docs/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ associated with the ``Author`` type::
authorSchema :: TableSchema (Author Name)
authorSchema = TableSchema
{ name = "author"
, schema = Nothing
, columns = Author
{ authorId = "author_id"
, authorName = "name"
Expand All @@ -139,6 +140,7 @@ And likewise for ``project`` and ``Project``::
projectSchema :: TableSchema (Project Name)
projectSchema = TableSchema
{ name = "project"
, schema = Nothing
, columns = Project
{ projectAuthorId = "author_id"
, projectName = "name"
Expand All @@ -151,6 +153,7 @@ information from your ``Rel8able`` type::
projectSchema :: TableSchema (Project Name)
projectSchema = TableSchema
{ name = "project"
, schema = Nothing
, columns = namesFromLabels @(Project Name)
}

Expand Down
Loading