persistent-2.10 support (#122)

* persistent-2.10 support

* ignore cabal file

* 3.0.0

* update changelog [ci skip]
This commit is contained in:
Matt Parsons 2019-04-22 21:24:40 -07:00 committed by GitHub
parent a0274e377b
commit 7b7717b05a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 24 additions and 174 deletions

1
.gitignore vendored
View File

@ -4,3 +4,4 @@
.cabal-sandbox/
cabal.sandbox.config
.hspec-failures
esqueleto.cabal

View File

@ -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

View File

@ -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
=======

View File

@ -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 <https://github.com/bitemyapp/esqueleto>.
.
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

View File

@ -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

View File

@ -97,13 +97,11 @@ module Database.Esqueleto.Internal.PersistentImport
RawSql(..),
CautiousMigration,
Column(..),
Connection,
ConnectionPool,
Migration,
PersistentSqlException(..),
Single(..),
Sql,
SqlPersist,
SqlPersistM,
SqlPersistT,
InsertSqlResult(..),

View File

@ -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

View File

@ -1 +1 @@
stack-8.4.yaml
stack-8.6.yaml

View File

@ -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