From 42178ca29cd63289ddc3254e245aef97dc53b7af Mon Sep 17 00:00:00 2001 From: parsonsmatt Date: Thu, 31 Jan 2019 14:36:13 -0700 Subject: [PATCH 1/8] Add changelog and README to package --- changelog.md | 3 +++ esqueleto.cabal | 7 +++++-- package.yaml | 3 +++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index 79af664..d87db22 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,6 @@ +Unreleased +======== + 2.6.0 ======== - @bitemyapp diff --git a/esqueleto.cabal b/esqueleto.cabal index 524adad..b92d7f9 100644 --- a/esqueleto.cabal +++ b/esqueleto.cabal @@ -1,10 +1,10 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.31.0. +-- This file has been generated from package.yaml by hpack version 0.31.1. -- -- see: https://github.com/sol/hpack -- --- hash: c5408ff1923a2a70cf9c7b5590f83d724453768845c1dd1d92888c177dfad357 +-- hash: 3a3f42ca57c8ee2f4d01724057ff86b8867202c138e6f03cd8c23000da1fbaa3 name: esqueleto version: 2.6.0 @@ -24,6 +24,9 @@ copyright: (c) 2012-2016 Felipe Almeida Lessa license: BSD3 license-file: LICENSE build-type: Simple +extra-source-files: + README.md + changelog.md source-repository head type: git diff --git a/package.yaml b/package.yaml index c7a24fa..5090929 100644 --- a/package.yaml +++ b/package.yaml @@ -41,6 +41,9 @@ copyright: (c) 2012-2016 Felipe Almeida Lessa license: BSD3 homepage: https://github.com/bitemyapp/esqueleto git: git://github.com/bitemyapp/esqueleto.git +extra-source-files: +- README.md +- changelog.md dependencies: - base >=4.8 && <5.0 From 6ef22d1ff7099901b93886732d6ba787f585a941 Mon Sep 17 00:00:00 2001 From: Chris Coffey Date: Sat, 16 Feb 2019 21:04:49 -0500 Subject: [PATCH 2/8] Export Persistent.Sql module explicitly --- .../Esqueleto/Internal/PersistentImport.hs | 141 +++++++++++++++++- 1 file changed, 140 insertions(+), 1 deletion(-) diff --git a/src/Database/Esqueleto/Internal/PersistentImport.hs b/src/Database/Esqueleto/Internal/PersistentImport.hs index 0475e31..1455542 100644 --- a/src/Database/Esqueleto/Internal/PersistentImport.hs +++ b/src/Database/Esqueleto/Internal/PersistentImport.hs @@ -1,7 +1,146 @@ -- | Re-export "Database.Persist.Sql" without any clashes with -- @esqueleto@. module Database.Esqueleto.Internal.PersistentImport - ( module Database.Persist.Sql + ( toJsonText, + entityIdFromJSON, + entityIdToJSON, + entityValues, + fromPersistValueJSON, + keyValueEntityFromJSON, + keyValueEntityToJSON, + toPersistValueJSON, + selectKeys, + belongsTo, + belongsToJust, + getEntity, + getJust, + getJustEntity, + insertEntity, + insertRecord, + liftPersist, + checkUnique, + getByValue, + insertBy, + insertUniqueEntity, + onlyUnique, + replaceUnique, + transactionSave, + transactionUndo, + defaultAttribute, + mkColumns, + getMigration, + migrate, + parseMigration, + parseMigration', + printMigration, + runMigration, + runMigrationSilent, + runMigrationUnsafe, + showMigration, + decorateSQLWithLimitOffset, + fieldDBName, + fromSqlKey, + getFieldName, + getTableName, + tableDBName, + toSqlKey, + withRawQuery, + getStmtConn, + rawExecute, + rawExecuteCount, + rawQuery, + rawQueryRes, + rawSql, + executeQQ, + sqlQQ, + askLogFunc, + close', + createSqlPool, + liftSqlPersistMPool, + runSqlConn, + runSqlPersistM, + runSqlPersistMPool, + runSqlPool, + withSqlConn, + withSqlPool, + readToUnknown, + readToWrite, + writeToUnknown, + entityKeyFields, + entityPrimary, + fromPersistValueText, + keyAndEntityFields, + toEmbedEntityDef, + PersistStore, + PersistUnique, + DeleteCascade(..), + PersistConfig(..), + BackendSpecificUpdate, + Entity(..), + PersistEntity(..), + PersistField(..), + SomePersistField(..), + PersistQueryRead(..), + PersistQueryWrite(..), + BackendCompatible(..), + BackendKey(..), + HasPersistBackend(..), + IsPersistBackend, + PersistCore(..), + PersistRecordBackend, + PersistStoreRead(..), + PersistStoreWrite(..), + ToBackendKey(..), + PersistUniqueRead(..), + PersistUniqueWrite(..), + PersistFieldSql(..), + RawSql(..), + CautiousMigration, + Column(..), + Connection, + ConnectionPool, + Migration, + PersistentSqlException(..), + Single(..), + Sql, + SqlPersist, + SqlPersistM, + SqlPersistT, + InsertSqlResult(..), + IsSqlBackend, + LogFunc, + SqlBackend(..), + SqlBackendCanRead, + SqlBackendCanWrite, + SqlReadBackend(..), + SqlReadT, + SqlWriteBackend(..), + SqlWriteT, + Statement(..), + Attr, + Checkmark(..), + CompositeDef(..), + DBName(..), + EmbedEntityDef(..), + EmbedFieldDef(..), + EntityDef(..), + ExtraLine, + FieldDef(..), + FieldType(..), + ForeignDef(..), + ForeignFieldDef, + HaskellName(..), + IsNullable(..), + OnlyUniqueException(..), + PersistException(..), + PersistFilter(..), + PersistUpdate(..), + PersistValue(..), + ReferenceDef(..), + SqlType(..), + UniqueDef(..), + UpdateException(..), + WhyNullable(..) ) where import Database.Persist.Sql hiding From 91c9cf439ebe8a2411414aa28945490e3bbdafc9 Mon Sep 17 00:00:00 2001 From: Chris Coffey Date: Sun, 17 Feb 2019 16:28:38 -0500 Subject: [PATCH 3/8] Add comment explaining the export lits --- src/Database/Esqueleto/Internal/PersistentImport.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Database/Esqueleto/Internal/PersistentImport.hs b/src/Database/Esqueleto/Internal/PersistentImport.hs index 1455542..b30875e 100644 --- a/src/Database/Esqueleto/Internal/PersistentImport.hs +++ b/src/Database/Esqueleto/Internal/PersistentImport.hs @@ -1,6 +1,8 @@ -- | Re-export "Database.Persist.Sql" without any clashes with -- @esqueleto@. module Database.Esqueleto.Internal.PersistentImport +-- NOTE: switch back to a module export once https://gitlab.haskell.org/ghc/ghc/merge_requests/276 +-- has been merged. See https://github.com/bitemyapp/esqueleto/issues/110 for more details ( toJsonText, entityIdFromJSON, entityIdToJSON, From ce0c99a3bfa63f076726aedc2d12b732fe526f49 Mon Sep 17 00:00:00 2001 From: parsonsmatt Date: Mon, 4 Mar 2019 17:56:30 -0700 Subject: [PATCH 4/8] 2.6.1 --- changelog.md | 7 +++++++ esqueleto.cabal | 4 ++-- package.yaml | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/changelog.md b/changelog.md index d87db22..b1d972d 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,13 @@ Unreleased ======== +2.6.1 +======= + +- @ChrisCoffey + - [#114](https://github.com/bitemyapp/esqueleto/pull/114): Fix Haddock by + working around an upstream bug. + 2.6.0 ======== - @bitemyapp diff --git a/esqueleto.cabal b/esqueleto.cabal index b92d7f9..a6b7d88 100644 --- a/esqueleto.cabal +++ b/esqueleto.cabal @@ -4,10 +4,10 @@ cabal-version: 1.12 -- -- see: https://github.com/sol/hpack -- --- hash: 3a3f42ca57c8ee2f4d01724057ff86b8867202c138e6f03cd8c23000da1fbaa3 +-- hash: c68a1e254e29c461cbf88a8a32c039563f3576cf439b9d947cb3d8dd3916e0e8 name: esqueleto -version: 2.6.0 +version: 2.6.1 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. . diff --git a/package.yaml b/package.yaml index 5090929..d3825be 100644 --- a/package.yaml +++ b/package.yaml @@ -1,5 +1,5 @@ name: esqueleto -version: '2.6.0' +version: 2.6.1 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 From 094ae18cae1d2229a48854cb93eb9debd9dcea39 Mon Sep 17 00:00:00 2001 From: parsonsmatt Date: Tue, 5 Mar 2019 12:50:49 -0700 Subject: [PATCH 5/8] Remove QQ re-exports --- changelog.md | 6 ++++++ package.yaml | 2 +- src/Database/Esqueleto/Internal/PersistentImport.hs | 2 -- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/changelog.md b/changelog.md index b1d972d..5bb0279 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,12 @@ Unreleased ======== +2.6.2 +======= + +- @parsonsmatt + - [#117](https://github.com/bitemyapp/esqueleto/pull/117): Removed `sqlQQ` and `executeQQ` functions from export, fixing doc build and building with `persistent` >= 2.9 + 2.6.1 ======= diff --git a/package.yaml b/package.yaml index d3825be..7dc7317 100644 --- a/package.yaml +++ b/package.yaml @@ -1,5 +1,5 @@ name: esqueleto -version: 2.6.1 +version: 2.6.2 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 diff --git a/src/Database/Esqueleto/Internal/PersistentImport.hs b/src/Database/Esqueleto/Internal/PersistentImport.hs index b30875e..9cab41c 100644 --- a/src/Database/Esqueleto/Internal/PersistentImport.hs +++ b/src/Database/Esqueleto/Internal/PersistentImport.hs @@ -53,8 +53,6 @@ module Database.Esqueleto.Internal.PersistentImport rawQuery, rawQueryRes, rawSql, - executeQQ, - sqlQQ, askLogFunc, close', createSqlPool, From 7a84e836756fd301453a000be625aa696eb2cf50 Mon Sep 17 00:00:00 2001 From: parsonsmatt Date: Tue, 5 Mar 2019 13:57:35 -0700 Subject: [PATCH 6/8] Revise version number [skip ci] --- changelog.md | 2 +- esqueleto.cabal | 4 ++-- package.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/changelog.md b/changelog.md index 5bb0279..2140820 100644 --- a/changelog.md +++ b/changelog.md @@ -1,7 +1,7 @@ Unreleased ======== -2.6.2 +2.7.0 ======= - @parsonsmatt diff --git a/esqueleto.cabal b/esqueleto.cabal index a6b7d88..234c0bb 100644 --- a/esqueleto.cabal +++ b/esqueleto.cabal @@ -4,10 +4,10 @@ cabal-version: 1.12 -- -- see: https://github.com/sol/hpack -- --- hash: c68a1e254e29c461cbf88a8a32c039563f3576cf439b9d947cb3d8dd3916e0e8 +-- hash: b9e04d2f75b2f0eaebcef3906057ae77f42a6455f7bd453c3f7ed399b1669e8e name: esqueleto -version: 2.6.1 +version: 2.6.2 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. . diff --git a/package.yaml b/package.yaml index 7dc7317..9e449a0 100644 --- a/package.yaml +++ b/package.yaml @@ -1,5 +1,5 @@ name: esqueleto -version: 2.6.2 +version: 2.7.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 From 135064684cfea138b31f1dd4a0115e35e88843b6 Mon Sep 17 00:00:00 2001 From: parsonsmatt Date: Mon, 11 Mar 2019 10:04:05 -0600 Subject: [PATCH 7/8] Regenerate cabal file, fixes #118 --- esqueleto.cabal | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esqueleto.cabal b/esqueleto.cabal index 234c0bb..3cd79ab 100644 --- a/esqueleto.cabal +++ b/esqueleto.cabal @@ -4,10 +4,10 @@ cabal-version: 1.12 -- -- see: https://github.com/sol/hpack -- --- hash: b9e04d2f75b2f0eaebcef3906057ae77f42a6455f7bd453c3f7ed399b1669e8e +-- hash: 079b7696691db785c8028b0c1fad5239285ea361eed8a8f3c05d8a42250dc541 name: esqueleto -version: 2.6.2 +version: 2.7.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. . From 67b75ce0ab995c7916fb5532cdaa29de4c57e788 Mon Sep 17 00:00:00 2001 From: Steven Leiva Date: Sat, 6 Apr 2019 10:50:01 -0500 Subject: [PATCH 8/8] Update README.md The application of `just` is unnecessary, and actually leads to a type error. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 217a9fd..b52de90 100644 --- a/README.md +++ b/README.md @@ -158,7 +158,7 @@ However, you may want your results to include people who don't have any blog pos ```haskell select $ from $ \(p `LeftOuterJoin`` mb) -> do -on (just (p ^. PersonId) ==. mb ?. BlogPostAuthorId) +on (p ^. PersonId ==. mb ?. BlogPostAuthorId) orderBy [asc (p ^. PersonName), asc (mb ?. BlogPostTitle)] return (p, mb) ```