diff --git a/.gitignore b/.gitignore index 6a8c43a..3f62c52 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ .cabal-sandbox/ cabal.sandbox.config .hspec-failures +esqueleto.cabal diff --git a/.travis.yml b/.travis.yml index a472305..98fc04b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,9 +34,7 @@ script: - stack setup - stack update - stack build - - stack test -- esqueleto:postgresql - - stack test -- esqueleto:sqlite - - stack test -- esqueleto:mysql || exit 0 # TODO: Remove that exit 0 when mysql tests are checking correctly + - stack test - cd test/expected-compile-failures/ - bash test.sh diff --git a/changelog.md b/changelog.md index 2140820..7193682 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,13 @@ Unreleased ======== +3.0.0 +======= + +- @parsonsmatt + - [#122](https://github.com/bitemyapp/esqueleto/pull/122): Support `persistent-2.10.0`. This is a breaking change due to the removal of deprecated exports from the `persistent` library. + - [#113](https://github.com/bitemyapp/esqueleto/pull/113): Remove the `esqueleto` type class. To migrate here, use `SqlExpr`, `SqlQuery`, and `SqlBackend` instead of using the polymorphic `Esqueleto sqlExpr sqlQuery sqlBackend => ...` types. + 2.7.0 ======= diff --git a/esqueleto.cabal b/esqueleto.cabal deleted file mode 100644 index 40f654a..0000000 --- a/esqueleto.cabal +++ /dev/null @@ -1,161 +0,0 @@ -cabal-version: 1.12 - --- This file has been generated from package.yaml by hpack version 0.31.1. --- --- see: https://github.com/sol/hpack --- --- hash: 23efdc2ff821db986867d35578cf56e958a8cdc351813fe6c6cfdbd4a173a994 - -name: esqueleto -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. - . - @persistent@ is a library for type-safe data serialization. It has many kinds of backends, such as SQL backends (@persistent-mysql@, @persistent-postgresql@, @persistent-sqlite@) and NoSQL backends (@persistent-mongoDB@). While @persistent@ is a nice library for storing and retrieving records, including with filters, it does not try to support some of the features that are specific to SQL backends. In particular, @esqueleto@ is the recommended library for type-safe @JOIN@s on @persistent@ SQL backends. (The alternative is using raw SQL, but that's error prone and does not offer any composability.) - . - Currently, @SELECT@s, @UPDATE@s, @INSERT@s and @DELETE@s are supported. Not all SQL features are available, but most of them can be easily added (especially functions), so please open an issue or send a pull request if you need anything that is not covered by @esqueleto@ on . - . - The name of this library means \"skeleton\" in Portuguese and contains all three SQL letters in the correct order =). It was inspired by Scala's Squeryl but created from scratch. -category: Database -homepage: https://github.com/bitemyapp/esqueleto -author: Felipe Lessa -maintainer: cma@bitemyapp.com -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 - location: git://github.com/bitemyapp/esqueleto.git - -library - exposed-modules: - Database.Esqueleto - Database.Esqueleto.Internal.Language - Database.Esqueleto.Internal.Sql - Database.Esqueleto.MySQL - Database.Esqueleto.PostgreSQL - Database.Esqueleto.SQLite - other-modules: - Database.Esqueleto.Internal.Internal - Database.Esqueleto.Internal.PersistentImport - Paths_esqueleto - hs-source-dirs: - src/ - build-depends: - base >=4.8 && <5.0 - , blaze-html - , bytestring - , conduit >=1.3 - , monad-logger - , persistent >=2.8.0 && <2.10 - , resourcet >=1.2 - , tagged >=0.2 - , text >=0.11 && <1.3 - , time >=1.5.0.1 && <=1.8.0.2 - , transformers >=0.2 - , unliftio - , unordered-containers >=0.2 - if impl(ghc >=8.0) - ghc-options: -Wall -Wno-redundant-constraints - else - ghc-options: -Wall - default-language: Haskell2010 - -test-suite mysql - type: exitcode-stdio-1.0 - main-is: MySQL/Test.hs - other-modules: - Common.Test - Paths_esqueleto - hs-source-dirs: - test - ghc-options: -Wall - build-depends: - base >=4.8 && <5.0 - , blaze-html - , bytestring - , conduit >=1.3 - , containers - , esqueleto - , hspec - , monad-logger - , mysql - , mysql-simple - , persistent >=2.8.0 && <2.10 - , persistent-mysql - , persistent-template - , resourcet >=1.2 - , tagged >=0.2 - , text >=0.11 && <1.3 - , time >=1.5.0.1 && <=1.8.0.2 - , transformers >=0.2 - , unliftio - , unordered-containers >=0.2 - default-language: Haskell2010 - -test-suite postgresql - type: exitcode-stdio-1.0 - main-is: PostgreSQL/Test.hs - other-modules: - Common.Test - Paths_esqueleto - hs-source-dirs: - test - ghc-options: -Wall - build-depends: - base >=4.8 && <5.0 - , blaze-html - , bytestring - , conduit >=1.3 - , containers - , esqueleto - , hspec - , monad-logger - , persistent >=2.8.0 && <2.10 - , persistent-postgresql - , persistent-template - , postgresql-libpq - , postgresql-simple - , resourcet >=1.2 - , tagged >=0.2 - , text >=0.11 && <1.3 - , time >=1.5.0.1 && <=1.8.0.2 - , transformers >=0.2 - , unliftio - , unordered-containers >=0.2 - default-language: Haskell2010 - -test-suite sqlite - type: exitcode-stdio-1.0 - main-is: SQLite/Test.hs - other-modules: - Common.Test - Paths_esqueleto - hs-source-dirs: - test - ghc-options: -Wall - build-depends: - base >=4.8 && <5.0 - , blaze-html - , bytestring - , conduit >=1.3 - , containers - , esqueleto - , hspec - , monad-logger - , persistent >=2.8.0 && <2.10 - , persistent-sqlite - , persistent-template - , resourcet >=1.2 - , tagged >=0.2 - , text >=0.11 && <1.3 - , time >=1.5.0.1 && <=1.8.0.2 - , transformers >=0.2 - , unliftio - , unordered-containers >=0.2 - default-language: Haskell2010 diff --git a/package.yaml b/package.yaml index 9e449a0..86991a1 100644 --- a/package.yaml +++ b/package.yaml @@ -1,5 +1,5 @@ name: esqueleto -version: 2.7.0 +version: 3.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 @@ -51,7 +51,7 @@ dependencies: - bytestring - conduit >=1.3 - monad-logger - - persistent >=2.8.0 && <2.10 + - persistent >=2.8.0 && <2.11 - resourcet >=1.2 - tagged >=0.2 - text >=0.11 && <1.3 diff --git a/src/Database/Esqueleto/Internal/PersistentImport.hs b/src/Database/Esqueleto/Internal/PersistentImport.hs index 9cab41c..55e460b 100644 --- a/src/Database/Esqueleto/Internal/PersistentImport.hs +++ b/src/Database/Esqueleto/Internal/PersistentImport.hs @@ -97,13 +97,11 @@ module Database.Esqueleto.Internal.PersistentImport RawSql(..), CautiousMigration, Column(..), - Connection, ConnectionPool, Migration, PersistentSqlException(..), Single(..), Sql, - SqlPersist, SqlPersistM, SqlPersistT, InsertSqlResult(..), diff --git a/stack-8.6.yaml b/stack-8.6.yaml index 6514933..ce889a4 100644 --- a/stack-8.6.yaml +++ b/stack-8.6.yaml @@ -1,5 +1,12 @@ -# TODO: switch resolver to lts-13.x once that is released -resolver: nightly-2018-12-05 +resolver: lts-13.6 packages: - '.' + +extra-deps: +- persistent-2.10.0 +- persistent-template-2.7.0 +- persistent-mysql-2.10.0 +- persistent-postgresql-2.10.0 +- postgresql-simple-0.6.1 +- persistent-sqlite-2.10.0 diff --git a/stack.yaml b/stack.yaml index 461dfa7..153fe73 120000 --- a/stack.yaml +++ b/stack.yaml @@ -1 +1 @@ -stack-8.4.yaml \ No newline at end of file +stack-8.6.yaml \ No newline at end of file diff --git a/test/Common/Test.hs b/test/Common/Test.hs index d5cac2c..a69f534 100644 --- a/test/Common/Test.hs +++ b/test/Common/Test.hs @@ -2,6 +2,7 @@ {-# OPTIONS_GHC -fno-warn-deprecations #-} {-# LANGUAGE ConstraintKinds , CPP + , UndecidableInstances , EmptyDataDecls , FlexibleContexts , FlexibleInstances @@ -88,7 +89,7 @@ share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persistUpperCase| age Int Maybe weight Int Maybe favNum Int - deriving Eq Show + deriving Eq Show Ord BlogPost title String authorId PersonId @@ -1123,8 +1124,7 @@ testListOfValues run = do return (bp ^. BlogPostAuthorId) where_ (p ^. PersonId `in_` subList_select subquery) return p - liftIO $ ret `shouldBe` [ Entity p1k p1 - , Entity p3k p3 ] + liftIO $ L.sort ret `shouldBe` L.sort [Entity p1k p1, Entity p3k p3] it "NOT IN works for subList_select" $ run $ do