Changelog for esqueleto-3.6.0.0
3.6.0.0
- @parsonsmatt
- #422
- The instance of
HasFieldforSqlExpr (Maybe (Entity a))joinsMaybevalues together. This means that if youleftJoina table with aMaybecolumn, the result will be aSqlExpr (Value (Maybe typ)), instead ofSqlExpr (Value (Maybe (Maybe typ))). - To make this a less breaking change,
joinVhas been given a similar behavior. If the input type tojoinVisMaybe (Maybe typ), then the result becomesMaybe typ. If the input type isMaybe typ, then the output is alsoMaybe typ. ThejoinV'function is given as an alternative with monomorphic behavior. - The
justfunction is also modified to avoid nestingMaybe. Likewise,just'is provided to give monomorphic behavior. subSelect,max_,min_, andcoalescewere all givenNullableoutput types as well. This should help to reduce the incidence of nestedMaybe.- The operator
??.was introduced which can do nestedMaybe. You may want this if you have type inference issues with?.combiningMaybe.
- The instance of
- #420
- Add a fixity declaration to
?.
- Add a fixity declaration to
- #412
- The
random_andrandfunctions (deprecated in 2.6.0) have been removed. Please refer to the database specific ones (ieDatabase.Esqueleto.PostgreSQLetc) - The
sub_selectfunction (deprecated in 3.2.0) has been removed. Please use the safer variants likesubSelect,subSelectMaybe, etc. - The
ToAliasTandToAliasReferenceTtypes has been removed after having been deprecated in 3.4.0.1. - The
Uniontype (deprecated in 3.4) was removed. Please useunion_instead. - The
UnionAlltype (deprecated in 3.4) was removed. Please useunionAll_instead. - The
Excepttype (deprecated in 3.4) was removed. Please useexcept_instead. - The
Intersecttype (deprecated in 3.4) was removed. Please useintersect_instead. - The
SubQuerytype (deprecated in 3.4) was removed. You do not need to tag subqueries to use them infromclauses. - The
SelectQuerytype (deprecated in 3.4) was removed. You do not need to tagSqlQueryvalues withSelectQuery.
- The
- #287
- Deprecate
distinctOnanddistinctOnOrderBy. Use the variants defined inPostgreSQLmodule instead. The signature has changed, but the refactor is straightforward:-- old: p <- from $ table distinctOn [don x] $ do pure p -- new: p <- from $ table distinctOn [don x] pure p
- Deprecate
- #301
- Postgresql
upsertandupsertBynow require aNonEmptylist of updates. If you want to provide an empty list of updates, you'll need to useupsertMaybeandupsertMaybeBeinstead. Postgres does not return rows from the database if no updates are performed.
- Postgresql
- #413
- The ability to
coerceSqlExprwas removed. Instead, useveryUnsafeCoerceSqlExpr. See the documentation onveryUnsafeCoerceSqlExprfor safe use example.
- The ability to
- #420
- The
LockingKindconstructors are deprecated, and will be removed from non-Internal modules in a future release. Smart constructors replace them, and you may need to import them from a different database-specific module.
- The
- #422
3.5.14.0
- @parsonsmatt
- @matthewbauer
- #341
- Add functions for
NULLS FIRSTandNULLS LASTin the Postgresql module
- Add functions for
- #341
- @JoelMcCracken
3.5.13.2
- @blujupiter32
- #379
- Fix a bug where
not_ (a &&. b)would be interpeted as(not_ a) &&. b
- Fix a bug where
- #379
- @RikvanToor
- @TeofilC
- #394
- Use TH quotes to eliminate some CPP.
- #394
- @parsonsmatt, @jappeace
3.5.13.1
- @csamak
- #405
- Fix a bug introduced in 3.5.12.0 where deriveEsqueletoRecord incorrectly errors
- #405
3.5.13.0
- @ac251
- #402
- Add
forNoKeyUpdateandforKeySharelocking kinds for postgres
- Add
- #402
3.5.12.0
- @csamak
- #405
ToMaybeinstances are now derived for Maybe records. See Issue #401.
- #405
3.5.11.2
- @arguri
- #387
- Fix build for ghc 9.8.1 / template-haskell 2.18
- #387
3.5.11.0
- @9999years, @halogenandtoast
- #378
ToMaybeinstances are now derived for records so you can now left join them in queries
- #378
3.5.10.3
- @ttuegel
- #377
- Fix Postgres syntax for
noWait
- Fix Postgres syntax for
- #377
3.5.10.2
- @parsonsmatt
- #376
-
When using Postgres 15,
LIMIT, and thelockingfunctions, 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.
-
- #376
3.5.10.1
- @9999years
- #369
- Fix
myAgetype inderiveEsqueletoRecorddocumentation
- Fix
- #369
3.5.10.0
- @ivanbakel
- #328
- Add
ToAliasinstances for 9- to 16-tuples - Add
ToAliasReferenceinstances for 9- to 16-tuples
- Add
- #328
- @parsonsmatt
- #365
- Add
isNothing_andgroupBy_to avoid name conflicts withData.ListandData.Maybe.
- Add
- #365
3.5.9.1
- @duplode
- #363
- Add missing
justto left join examples in the Haddocks
- Add missing
- #363
3.5.9.0
- @9999years
- #350
- Add
GetFirstTable,getTable,getTableMaybehelpers for selecting tables from:&chains
- Add
- #350
- @josephsumabat
- #339
- Add
forUpdateOf,forShareOflocking kinds for postgres
- Add
- #339
- @parsonsmatt
- #342
- Create a
TypeErrorinstance forFunctor SqlExpr, adding documentation and work arounds for the need.
- Create a
- #342
- @9999years
- #327
- Fixed a Haddock typo causing documentation to render incorrectly
- #327
3.5.8.1
- @belevy
- #336
- Fix bug with multiple nested subqueries introduced in 3.5.7.1
- Set operations will now only reuse variable names within the context of the set operation. a subquery that references the set operation will correctly pick up where the subquery left off 3.5.8.0 =======
- #336
- @ivanbakel
- #331
- Add
deriveEsqueletoRecordWithto derive Esqueleto instances for records using custom deriving settings. - Add
DeriveEsqueletoRecordSettingsto control how Esqueleto record instances are derived. - Add
sqlNameModifierto control how Esqueleto record instance deriving generates the SQL record type name. - Add
sqlFieldModifierto control how Esqueleto record instance deriving generates the SQL record fields.
- Add
- #331
3.5.7.1
- @belevy
- #334
- Fix alias name bug with union and subselect
- #334
3.5.7.0
-
@ivanbakel
- #329
- Add
ToAliasandToAliasReferenceinstances to the type produced byderiveEsqueletoRecord, allowing in-SQL records to be used in CTEs
- Add
- #329
-
@9999years
- #324
- Add ability to use nested records with
deriveEsqueletoRecord
- Add ability to use nested records with
- #324
3.5.6.0
- @9999years
- #323
- Add ability to derive esqueleto instances for records
- #323
3.5.5.0
- @parsonsmatt
- #317
- Add
EqandShowinstances to:&
- Add
- #317
3.5.4.2
- @parsonsmatt
- #318
- Remove use of
SqlReadTandSqlWriteTtype alias so that Simplified Subsumption doesn't bite end users
- Remove use of
- #318
3.5.4.1
- @parsonsmatt
- #312
- Support
persistent-2.14.0.0
- Support
- #312
3.5.4.0
- @parsonsmatt
- #310
- Add instances of
HasFieldforSqlExpr (Entity rec)andSqlExpr (Maybe (Entity rec)). These instances allow you to use theOverloadedRecordDotlanguage extension in GHC 9.2 with SQL representations of database entities.
- Add instances of
- #310
3.5.3.2
- @parsonsmatt
- #309
- Bump
timeversion bound
- Bump
- #309
3.5.3.1
- @jappeace
- #303
- Added docs for delete function for new experimental API.
- #303
3.5.3.0
- @m4dc4p
- #291
- Added
ToAliasandToAliasReferenceinstaces to the:&type, mirroring the tuple instances for the same classes. See Issue #290 for discussion.
- #291
- Added
- @NikitaRazmakhnin
- #284 - Add PostgreSQL-specific support of VALUES(..) literals
3.5.2.2
- @NikitaRazmakhnin
- #278
- Fix generating of bad sql using nexted expressions with
distinctOnOrderBy.
- #278
- Fix generating of bad sql using nexted expressions with
3.5.2.1
- @cdparks
- #273
- Avoid generating an empty list as the left operand to
NOT IN.
- #273
- Avoid generating an empty list as the left operand to
3.5.2.0
- @ivanbakel
- #268
- Added
SqlSelectinstance for(:&), allowing it to be returned from queries just like(,)tuples.
- #268
- Added
3.5.1.0
- @ibarrae
- #265
- Added
selectOne
- #265
- Added
3.5.0.0
- @belevy
- #228 - Destroy all GADTs; Removes the From GADT and SqlExpr GADT - From GADT is replaced with a From data type and FromRaw - SqlExpr is now all defined in terms of ERaw - Modified ERaw to contain a SqlExprMeta with any extra information that may be needed - Experimental top level is now strictly for documentation and all the implementation details are in Experimental.* modules
- @parsonsmatt
- #259
- Create the
Database.Esqueleto.Legacymodule. TheDatabase.Esqueletomodule now emits a warning, directing users to either importDatabase.Esqueleto.Legacyto keep the old behavior or to importDatabase.Esqueleto.Experimentalto opt in to the new behavior. - Deleted the deprecated modules
Database.Esqueleto.Internal.{Language,Sql}. Please useDatabase.Esqueleto.Internal.Internalinstead, or ideally post what you need from the library so we can support you safely. - Support GHC 9
- Create the
- #259
3.4.2.2
- @parsonsmatt
- #255
- Fix a bug where a composite primary key in a
groupByclause would break.
- Fix a bug where a composite primary key in a
- #255
3.4.2.1
- @parsonsmatt
- #245
- Support
persistent-2.13
- Support
- #245
3.4.2.0
- @parsonsmatt
- #243
- Support
persistent-2.12
- Support
- #243
3.4.1.1
- @MaxGabriel
- #240
- Improve recommend hlint to avoid doing
x = NULLSQL queries
- Improve recommend hlint to avoid doing
- #240
3.4.1.0
- @arthurxavierx
- #238
- Fix non-exhaustive patterns in
unsafeSqlAggregateFunction
- Fix non-exhaustive patterns in
- #238
- @Vlix
- #232
- Export the
ValidOnClauseValuetype family
- Export the
- #232
3.4.0.1
- @arthurxavierx
- #221
- Deprecate
ToAliasTandToAliasReferenceT
- Deprecate
- #221
- @parsonsmatt
- #226
- Support
persistent-2.11
- Support
- #226
- @belevy
- #225
- Simplify
ToFromTextracting the overlapping and type error instances - Make
ToFromTand associated type family ofToFrom
- Simplify
- #225
3.4.0.0
- @belevy, @charukiewicz
- #215
- Added support for common table expressions (
with,withRecursive) - Added support for lateral JOINs with updated example (Example #6)
- Deprecated
SelectQuery, removing the neccessity to tagSqlQueryvalues - Deprecated use of data constructors for SQL set operations (replaced with functions)
- Refactored module structure to fix haddock build (fixes build from
3.3.4.0)
- Added support for common table expressions (
- #215
3.3.4.1
- @maxgabriel
- #214
- Add suggested hlint rules for proper
isNothingusage
- Add suggested hlint rules for proper
- #214
3.3.4.0
- @parsonsmatt
- #205
-
More documentation on the
Experimentalmodule -
Database.Esqueleto.Experimentalnow reexportsDatabase.Esqueleto, so the new "approved" import syntax is less verbose. Before, you'd write:import Database.Esqueleto hiding (from, on) import Database.Esqueleto.ExperimentalNow you can merely write:
import Database.Esqueleto.ExperimentalUsers will get 'redundant import' warnings if they followed the original syntax, the solution is evident from the error message provided.
-
- #205
3.3.3.3
- @belevy
- #191 - Bugfix rollup: Fix issue with extra characters in generated SQL; Fix ToAliasReference for already referenced values; Fix Alias/Reference for Maybe Entity
- @maxgabriel
- #203 Document
isNothing
- #203 Document
- @sestrella
- #198 - Allow PostgreSQL aggregate functions to take a filter clause
3.3.3.2
- @maxgabriel
- #190 Further document and test
ToBaseId
- #190 Further document and test
3.3.3.1
- @belevy
- #189 - Fix bug in function calls with aliased values introduced by SubQuery joins.
3.3.3.0
- @belevy
- #172 - Introduce new experimental module for joins, set operations (eg UNION), and safer queries from outer joins.
3.3.2
- @belevy
- #177 Fix natural key handling in (^.)
3.3.1.1
- @parsonsmatt
- #170 Add documentation to
groupByto explain tuple nesting.
- #170 Add documentation to
3.3.1
- @charukiewicz, @belevy, @joemalin95
- #167: Exposed functions that were added in
3.3.0
- #167: Exposed functions that were added in
3.3.0
- @charukiewicz, @belevy, @joemalin95
- #166: Add several common SQL string functions:
upper_,trim_,ltrim_,rtrim_,length_,left_,right_
- #166: Add several common SQL string functions:
3.2.3
- @hdgarrood
- #163: Allow
unsafeSqlFunctionto take up to 10 arguments without needing to nest tuples.
- #163: Allow
3.2.2
- @parsonsmatt
- #161: Fix an issue where nested joins didn't get the right on clause.
3.2.1
- @parsonsmatt
- #159: Add an instance of
UnsafeSqlFunction ()for 0-argument SQL functions.
- #159: Add an instance of
3.2.0
- @parsonsmatt
- #153: Deprecate
sub_selectand introducesubSelect,subSelectMaybe, andsubSelectUnsafe.
- #153: Deprecate
- @parsonsmatt
- #156: Remove the
restriction that
onclauses must appear in reverse order to the joining tables.
- #156: Remove the
restriction that
3.1.3
- @JoseD92
- #155: Added
insertSelectWithConflictpostgres function.
- #155: Added
3.1.2
- @tippenein
- #149: Added
associateJoinquery helpers.
- #149: Added
3.1.1
-
@JoseD92
- #149: Added
upsertsupport.
- #149: Added
-
@parsonsmatt
- #133: Added
renderQueryToTextand related functions.
- #133: Added
3.1.0
- @Vlix
- #128: Added
Database.Esqueleto.PostgreSQL.JSONmodule with JSON operators andJSONBdata type.
- #128: Added
- @ibarrae
- #127: Added
betweenand support for composite keys inunsafeSqlBinOp.
- #127: Added
3.0.0
- @parsonsmatt
- #122: Support
persistent-2.10.0. This is a breaking change due to the removal of deprecated exports from thepersistentlibrary. - #113: Remove the
esqueletotype class. To migrate here, useSqlExpr,SqlQuery, andSqlBackendinstead of using the polymorphicEsqueleto sqlExpr sqlQuery sqlBackend => ...types.
- #122: Support
2.7.0
- @parsonsmatt
- #117: Removed
sqlQQandexecuteQQfunctions from export, fixing doc build and building withpersistent>= 2.9
- #117: Removed
2.6.1
- @ChrisCoffey
- #114: Fix Haddock by working around an upstream bug.
2.6.0
- @bitemyapp
- Reorganized dependencies, decided to break compatibility for Conduit 1.3, Persistent 2.8, and
unliftio. - Moved tests for
random()into database-specific test suites. - Deprecated Language
random_, split it into database-specific modules.
- Reorganized dependencies, decided to break compatibility for Conduit 1.3, Persistent 2.8, and
- @parsonsmatt
- Added support for
PersistQueryRead/PersistQueryWrite, enabling type-safe differentation of read and write capabilities.
- Added support for
- @sestrella
- Added support for
arrayAggDistinctandarrayRemove.
- Added support for
- @mheinzel
- Fixed JOIN syntax in the documentation https://github.com/bitemyapp/esqueleto/pull/60
- @illmade
- Added instructions for running database specific tests
- @FintanH
- Removed CPP from the test suite, split the database-specific tests into their own respective modules.
- Added support for PostgreSQL's
now() - Added a comprehensive examples project to make practical application of Esqueleto easier.
- @EdwardBetts
- Fixed a spelling error