Given that CI only seems to test against GHC 7.10 & GHC 8.0 it's safe to say that only
`base >= 4.8` is officially supported. And empirically, GHC 7.8.4 runs into the compile error below
```
Configuring component lib from esqueleto-2.5.0...
Preprocessing library esqueleto-2.5.0...
[1 of 5] Compiling Database.Esqueleto.Internal.PersistentImport ( src/Database/Esqueleto/Internal/PersistentImport.hs, /tmp/matrix-worker/1485112890/dist-newstyle/build/x86_64-linux/ghc-7.8.4/esqueleto-2.5.0/build/Database/Esqueleto/Internal/PersistentImport.o )
src/Database/Esqueleto/Internal/PersistentImport.hs:7:1: Warning:
The import item ‘PersistQuery(..)’ suggests that
‘PersistQuery’ has (in-scope) constructors or class methods,
but it has none
[2 of 5] Compiling Database.Esqueleto.Internal.Language ( src/Database/Esqueleto/Internal/Language.hs, /tmp/matrix-worker/1485112890/dist-newstyle/build/x86_64-linux/ghc-7.8.4/esqueleto-2.5.0/build/Database/Esqueleto/Internal/Language.o )
src/Database/Esqueleto/Internal/Language.hs:55:1: Warning:
The qualified import of ‘Data.ByteString.Lazy’ is redundant
except perhaps to import instances from ‘Data.ByteString.Lazy’
To import instances alone, use: import Data.ByteString.Lazy()
[3 of 5] Compiling Database.Esqueleto.Internal.Sql ( src/Database/Esqueleto/Internal/Sql.hs, /tmp/matrix-worker/1485112890/dist-newstyle/build/x86_64-linux/ghc-7.8.4/esqueleto-2.5.0/build/Database/Esqueleto/Internal/Sql.o )
src/Database/Esqueleto/Internal/Sql.hs:761:32:
Could not deduce (Functor m1) arising from a use of ‘<$>’
from the context (SqlSelect a r, MonadIO m1, MonadIO m2)
bound by the type signature for
rawSelectSource :: (SqlSelect a r, MonadIO m1, MonadIO m2) =>
Mode -> SqlQuery a -> SqlReadT m1 (Acquire (C.Source m2 r))
at src/Database/Esqueleto/Internal/Sql.hs:(753,20)-(758,57)
or from (SqlBackendCanRead backend)
bound by the type signature for
rawSelectSource :: (SqlBackendCanRead backend) =>
Mode
-> SqlQuery a -> R.ReaderT backend m1 (Acquire (C.Source m2 r))
at src/Database/Esqueleto/Internal/Sql.hs:(759,1)-(778,35)
Possible fix:
add (Functor m1) to the context of
the type signature for
rawSelectSource :: (SqlBackendCanRead backend) =>
Mode
-> SqlQuery a -> R.ReaderT backend m1 (Acquire (C.Source m2 r))
or the type signature for
rawSelectSource :: (SqlSelect a r, MonadIO m1, MonadIO m2) =>
Mode -> SqlQuery a -> SqlReadT m1 (Acquire (C.Source m2 r))
In a stmt of a 'do' block: conn <- persistBackend <$> R.ask
In the expression:
do { conn <- persistBackend <$> R.ask;
res <- run conn;
return $ (C.$= massage) `fmap` res }
In an equation for ‘rawSelectSource’:
rawSelectSource mode query
= do { conn <- persistBackend <$> R.ask;
res <- run conn;
return $ (C.$= massage) `fmap` res }
where
run conn
= uncurry rawQueryRes
$ first builderToText
$ toRawSql mode (conn, initialIdentState) query
massage
= do { mrow <- C.await;
.... }
process = sqlSelectProcessRow
src/Database/Esqueleto/Internal/Sql.hs:882:26:
Could not deduce (Functor m) arising from a use of ‘<$>’
from the context (MonadIO m, SqlSelect a r, IsSqlBackend backend)
bound by the type signature for
rawEsqueleto :: (MonadIO m, SqlSelect a r, IsSqlBackend backend) =>
Mode -> SqlQuery a -> R.ReaderT backend m Int64
at src/Database/Esqueleto/Internal/Sql.hs:(877,17)-(880,39)
Possible fix:
add (Functor m) to the context of
the type signature for
rawEsqueleto :: (MonadIO m, SqlSelect a r, IsSqlBackend backend) =>
Mode -> SqlQuery a -> R.ReaderT backend m Int64
In a stmt of a 'do' block: conn <- persistBackend <$> R.ask
In the expression:
do { conn <- persistBackend <$> R.ask;
uncurry rawExecuteCount
$ first builderToText
$ toRawSql mode (conn, initialIdentState) query }
In an equation for ‘rawEsqueleto’:
rawEsqueleto mode query
= do { conn <- persistBackend <$> R.ask;
uncurry rawExecuteCount
$ first builderToText
$ toRawSql mode (conn, initialIdentState) query }
```
123 lines
4.0 KiB
Plaintext
123 lines
4.0 KiB
Plaintext
name: esqueleto
|
|
version: 2.5.1
|
|
synopsis: Type-safe EDSL for SQL queries on persistent backends.
|
|
homepage: https://github.com/bitemyapp/esqueleto
|
|
license: BSD3
|
|
license-file: LICENSE
|
|
author: Felipe Lessa
|
|
maintainer: cma@bitemyapp.com
|
|
copyright: (c) 2012-2016 Felipe Almeida Lessa
|
|
category: Database
|
|
build-type: Simple
|
|
cabal-version: >=1.8
|
|
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.
|
|
|
|
source-repository head
|
|
type: git
|
|
location: git://github.com/bitemyapp/esqueleto.git
|
|
|
|
Flag postgresql
|
|
Description: test postgresql. default is to test sqlite.
|
|
Default: False
|
|
|
|
Flag mysql
|
|
Description: test MySQL/MariaDB. default is to test sqlite.
|
|
Default: False
|
|
|
|
library
|
|
exposed-modules:
|
|
Database.Esqueleto
|
|
Database.Esqueleto.PostgreSQL
|
|
Database.Esqueleto.Internal.Language
|
|
Database.Esqueleto.Internal.Sql
|
|
other-modules:
|
|
Database.Esqueleto.Internal.PersistentImport
|
|
build-depends:
|
|
base >= 4.8 && < 5.0
|
|
, bytestring
|
|
, text >= 0.11 && < 1.3
|
|
, persistent >= 2.5 && < 2.7
|
|
, transformers >= 0.2
|
|
, unordered-containers >= 0.2
|
|
, tagged >= 0.2
|
|
|
|
, monad-logger
|
|
, conduit >= 1.1
|
|
, resourcet >= 1.1
|
|
, blaze-html
|
|
hs-source-dirs: src/
|
|
if impl(ghc >= 8.0)
|
|
ghc-options: -Wall -Wno-redundant-constraints
|
|
else
|
|
ghc-options: -Wall
|
|
|
|
test-suite test
|
|
type: exitcode-stdio-1.0
|
|
ghc-options: -Wall
|
|
hs-source-dirs: test
|
|
main-is: Test.hs
|
|
build-depends:
|
|
-- Library dependencies used on the tests. No need to
|
|
-- specify versions since they'll use the same as above.
|
|
base, persistent, transformers, resourcet, text
|
|
|
|
-- Test-only dependencies
|
|
, conduit >= 1.1
|
|
, containers
|
|
, HUnit
|
|
, QuickCheck
|
|
, hspec >= 1.8
|
|
, persistent-sqlite >= 2.1
|
|
, persistent-template >= 2.1
|
|
, monad-control
|
|
, monad-logger >= 0.3
|
|
|
|
-- This library
|
|
, esqueleto
|
|
|
|
if flag(postgresql)
|
|
build-depends:
|
|
postgresql-simple >= 0.2
|
|
, postgresql-libpq >= 0.6
|
|
, persistent-postgresql >= 2.0
|
|
|
|
cpp-options: -DWITH_POSTGRESQL
|
|
|
|
if flag(mysql)
|
|
build-depends:
|
|
mysql-simple >= 0.2.2.3
|
|
, mysql >= 0.1.1.3
|
|
, persistent-mysql >= 2.0
|
|
|
|
cpp-options: -DWITH_MYSQL
|