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

Window functions and experimental syntax promotion (#325) #391

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
6 changes: 3 additions & 3 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ jobs:
--health-retries=3
strategy:
matrix:
cabal: ["3.6"]
ghc: ["8.6.5", "8.8.4", "8.10.4", "9.0.2", "9.2.2"]
cabal: ["3.10.2.1"]
ghc: ["8.6.5", "8.8.4", "8.10.4", "9.0.2", "9.2.2", "9.4.5", "9.6.2", "9.8.1"]
env:
CONFIG: "--enable-tests --enable-benchmarks "
steps:
- uses: actions/checkout@v2
- uses: haskell/actions/setup@v1
- uses: haskell/actions/setup@v2
id: setup-haskell-cabal
with:
ghc-version: ${{ matrix.ghc }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ Advantages:
- `ON` clause is attached directly to the relevant join, so you never need to
worry about how they're ordered, nor will you ever run into bugs where the
`on` clause is on the wrong `JOIN`
- The `ON` clause lambda will all the available tables in it. This forbids
- The `ON` clause lambda will exclusively have all the available tables in it. This forbids
runtime errors where an `ON` clause refers to a table that isn't in scope yet.
- You can join on a table twice, and the aliases work out fine with the `ON`
clause.
Expand Down
63 changes: 63 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,66 @@
4.0.0.0
=======
- @belevy
- Change Database.Esqueleto to use the new syntax, add warning to Database.Esqueleto.Experimental/Legacy mentioning their deprecation.
- Split SqlSelectCols typeclass out of SqlSelect, simplifying subquery type inference
- Change SqlExpr type to alias for new SqlExpr_ allowing for value "contexts". Currently used by window functions to avoid allowing double windowing. This change lays the groundwork for aggregate values as being contextually different from single values.
- Add support for window functions in Postgres module

3.5.11.2
========
- @arguri
- [#387](https://github.com/bitemyapp/esqueleto/pull/387)
- Fix build for ghc 9.8.1 / template-haskell 2.18

3.5.11.0
========
- @9999years, @halogenandtoast
- [#378](https://github.com/bitemyapp/esqueleto/pull/378)
- `ToMaybe` instances are now derived for records so you can now left
join them in queries

3.5.10.3
========
- @ttuegel
- [#377](https://github.com/bitemyapp/esqueleto/pull/377)
- Fix Postgres syntax for `noWait`

3.5.10.2
========
- @parsonsmatt
- [#376](https://github.com/bitemyapp/esqueleto/pull/376)
- When using Postgres 15, `LIMIT`, and the `locking` functions, you
could accidentally construct SQL code like:

> ... LIMIT 1FOR UPDATE ...

This parsed on Postgres <15, but the new Postgres parser is more
strict, and fails to parse. This PR introduces newlines between each
query chunk, which fixes the issue.

3.5.10.1
========
- @9999years
- [#369](https://github.com/bitemyapp/esqueleto/pull/369)
- Fix `myAge` type in `deriveEsqueletoRecord` documentation

3.5.10.0
========
- @ivanbakel
- [#328](https://github.com/bitemyapp/esqueleto/pull/328)
- Add `ToAlias` instances for 9- to 16-tuples
- Add `ToAliasReference` instances for 9- to 16-tuples
- @parsonsmatt
- [#365](https://github.com/bitemyapp/esqueleto/pull/365)
- Add `isNothing_` and `groupBy_` to avoid name conflicts with
`Data.List` and `Data.Maybe`.

3.5.9.1
=======
- @duplode
- [#363](https://github.com/bitemyapp/esqueleto/pull/363)
- Add missing `just` to left join examples in the Haddocks

3.5.9.0
=======
- @9999years
Expand Down
11 changes: 9 additions & 2 deletions esqueleto.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cabal-version: 1.12

name: esqueleto

version: 3.5.9.0
version: 4.0.0.0
synopsis: Type-safe EDSL for SQL queries on persistent backends.
description: @esqueleto@ is a bare bones, type-safe EDSL for SQL queries that works with unmodified @persistent@ SQL backends. Its language closely resembles SQL, so you don't have to learn new concepts, just new syntax, and it's fairly easy to predict the generated SQL and optimize it for your backend. Most kinds of errors committed when writing SQL are caught as compile-time errors---although it is possible to write type-checked @esqueleto@ queries that fail at runtime.
.
Expand Down Expand Up @@ -36,6 +36,9 @@ library
Database.Esqueleto.Internal.ExprParser
Database.Esqueleto.MySQL
Database.Esqueleto.PostgreSQL
Database.Esqueleto.PostgreSQL.Window
Database.Esqueleto.PostgreSQL.WindowFunction
Database.Esqueleto.PostgreSQL.Window.Frame
Database.Esqueleto.PostgreSQL.JSON
Database.Esqueleto.Record
Database.Esqueleto.SQLite
Expand Down Expand Up @@ -65,7 +68,7 @@ library
, resourcet >=1.2
, tagged >=0.2
, template-haskell
, text >=0.11 && <2.1
, text >=0.11 && <2.2
, time >=1.5.0.1 && <=1.13
, transformers >=0.2
, unliftio
Expand All @@ -87,14 +90,18 @@ test-suite specs
main-is: Spec.hs
other-modules:
Common.Test
Common.LegacyTest
Common.Test.Models
Common.Test.Import
Common.Test.Select
Common.Record
PostgreSQL.MigrateJSON
SQLite.Test
SQLite.LegacyTest
PostgreSQL.Test
PostgreSQL.LegacyTest
MySQL.Test
MySQL.LegacyTest
default-extensions:
RankNTypes
hs-source-dirs:
Expand Down
Loading