Commit Graph

171 Commits

Author SHA1 Message Date
Felix Paulusma
a452946f58 PostgreSQL JSON Operators (#128)
* added PostgreSQL.JSON module

* finished adding all JSON operators

* cleanup

* half way through writing tests

* final tweaks to comments

* finished with JSON tests

* upped persistent dependency to 2.10.0 because of PersistArray data constructor addition needed for JSON operators

* noticed the minus operator with text[] as right operand was only added in PSQL v10, added function and adjusted types/tests

* adjusted yaml configs for updated dependencies and PSQL v10 in Travis

* try to get PostgreSQL 10 running

* use @since notation

* removed postgresql from 'services' field

* and one more time, with FEELING! (and postgresql-10)

* foo

* PSQL 10 runs on 5433, it seems? reverting .travis.yml changes and setting test conn to port 5433

* of course I forget to add the PORT env > .<

* doop-dee-doo

* herp-a-derp

* last commit (hopefully)

* also have more recent dependencies in the 'compiler should error' tests

* why does it feel like this'll go on for a while still?

* copied some extra-deps from the persistent ymls

* aaaaand we're done... right?

* added persistent-postgresql to the dependencies and used its instances for Aeson.Value

* small comment fix

* moved the instances to their own module, this way they're optional to use if you don't use persistent-postgresql

* use port 5432, like a normal PostgreSQL!

* added JSONB newtype with instances, instead of orphaning Aeson.Value

* reworked everything to use the JSONB newtype. And adjusted most comments to reflect the change

* fixed all the tests (just making it compile again)

* that's right, Travis' PSQL v10 NEEEEDS it to be port 5433... for some reason

* update on the haddockumentation

* added JSONAccessor data type for easier usage of certain operators

* Also add to changelog.md

* JSONExpr -> JSONBExpr

* this damn PGPORT is really irritating
2019-08-04 22:10:31 -06:00
parsonsmatt
aa07462d17 Switch to cabal file for cabal.project builds 2019-05-13 09:05:39 -06:00
Matt Parsons
7b7717b05a
persistent-2.10 support (#122)
* persistent-2.10 support

* ignore cabal file

* 3.0.0

* update changelog [ci skip]
2019-04-22 21:24:40 -07:00
Matt Parsons
bfb602dcb7
Merge branch 'master' into matt/remove-class 2019-04-19 17:59:17 -06:00
parsonsmatt
135064684c Regenerate cabal file, fixes #118 2019-03-11 10:04:05 -06:00
parsonsmatt
7a84e83675 Revise version number [skip ci] 2019-03-05 13:57:35 -07:00
parsonsmatt
ce0c99a3bf 2.6.1 2019-03-04 17:56:30 -07:00
parsonsmatt
42178ca29c Add changelog and README to package 2019-02-07 20:25:39 -07:00
parsonsmatt
f749beafe6 Remove type class from core modules 2019-02-01 16:44:16 -07:00
parsonsmatt
5ebfb3aa49 Resolve merge 2018-12-18 13:10:37 -07:00
Dan Burton
8f23eae8b9 Update to ghc-8.6 and persistent-2.9 2018-12-18 13:06:33 -07:00
Chris Allen
3395e8ff96 Actually correct hpackification, Makefile edits 2018-02-28 13:50:34 -06:00
Chris Allen
7b09d61bc1 Hpackification 2018-02-28 13:19:41 -06:00
Chris Allen
391aa86464 Changelog, bifurcating random_ 2018-02-27 18:19:46 -06:00
Chris Allen
0acb568445 Updating for UnliftIO, Conduit 1.3, Persistent 2.8 2018-02-27 17:45:25 -06:00
Chris Allen
52d546f60b Matt's SQL compatible changes 2018-02-27 16:47:32 -06:00
Chris Allen
103fb6bf6b Fintan remove CPP 2018-02-27 16:45:07 -06:00
Matt Parsons
86c4c1a7b6 bump deps 2018-02-15 17:50:12 -07:00
Matt Parsons
7808bc982c Compatibility with new persistent 2018-01-19 09:59:35 -07:00
Sebastián Estrella
ea6f1807a4 Add arrayAggDistinct wrapper for PostgreSQL function 2018-01-10 10:02:44 -05:00
Matt Parsons
07167f6474 use upstream persistent 2017-10-23 11:16:59 -06:00
Fintan Halpenny
dd814584f3 No more CPP 2017-08-09 22:53:28 +01:00
Fintan Halpenny
3f1ffec01a Cleaning up cabal 2017-08-09 22:50:06 +01:00
Fintan Halpenny
1262c3fef9 Split into multiple testing stanzas and modules for backends
Common/Test.hs holds all common tests and functionality for the backends
2017-08-09 22:44:30 +01:00
Fintan Halpenny
fe4a78d4b6 Moved all describes tests into their own functions.
Factored out the db specific tests and kept the macros as placeholders.
Import everything in the cabal file for now.
Only using the flags to test that everything still works.
2017-08-09 00:19:09 +01:00
Fintan Halpenny
672f6e8884 Bumped up time package upper bound to 1.8.0.2 2017-08-04 15:17:12 +01:00
Fintan Halpenny
03c9590581 Added lower bound for package 2017-08-04 14:10:17 +01:00
Fintan Halpenny
013dc19b15 Accidentally committed True default for postgres 2017-08-03 20:47:43 +01:00
Fintan Halpenny
a4ebae2345 Use type constraint to constrain a to UTCTime 2017-08-02 16:34:46 +01:00
Fintan Halpenny
161914ddbc Added now_ function. Works in the tests (NOTE: It doesn not work in SQLite). Need to see if there is an answer for constraining the in to only know about time 2017-08-02 13:48:21 +01:00
Chris Allen
0c6bba7026 Formatting the Cabal file 2017-05-25 12:07:28 -05:00
Chris Allen
78eaf83859 Whitespace cleanup 2017-05-25 12:00:00 -05:00
Chris Allen
96cc3a546b Merge pull request #20 from ncaq/master
use persistent-sqlite >= 2.1.3
2017-05-25 11:21:18 -05:00
Sibi Prabakaran
52a442fb98
Allow persistent 2.7.0 2017-04-15 18:14:13 +05:30
Herbert Valerio Riedel
3e1d3deede Tighten version bound on base
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 }
```
2017-03-21 22:07:03 +01:00
Chris Allen
6e2b880488 Makefile, LTS for 8.0, bump version 2017-01-22 12:55:05 -06:00
Pascal Wittmann
3658f11a01 Update link in Hackage description 2017-01-16 20:55:16 +01:00
mrkkrp
eaa7c1057f Allow ‘persistent-2.6’ and ‘base-4.9’ 2017-01-11 03:08:10 +03:00
mrkkrp
42bcb97f41 Update source repository link in Cabal file 2017-01-08 18:48:05 +03:00
ncaq
75c3549c86 use persistent-sqlite >= 2.1.3 2016-12-16 15:47:56 +09:00
Chris Allen
ae82ee4826 Getting Travis working 2016-12-14 19:16:07 -06:00
Eric Easley
a5251302c8 Use released persistent-2.5 2016-04-14 15:20:57 -07:00
Felipe Lessa
c30aa5704d Bump version to 2.4.3. 2016-02-12 18:47:37 -02:00
Felipe Lessa
17b9c3be9a Bump version to 2.4.2. 2016-01-14 18:22:43 -02:00
Felipe Lessa
a59953954c Bump version to 2.4.1. 2015-08-11 12:05:24 -03:00
Felipe Lessa
4657230ca7 Bump version to 2.4.0. 2015-08-05 16:15:16 -03:00
Felipe Lessa
e5747fdfbf Bump version to 2.3.0. 2015-08-05 15:54:29 -03:00
Felipe Lessa
78a7fcdaeb New SqlString class, ditch IsString. 2015-08-05 15:54:16 -03:00
Felipe Lessa
9dbdcb53fa Bump version to 2.2.12. 2015-08-05 15:40:54 -03:00
Felipe Lessa
b2998bc7dc Bump version to 2.2.11. 2015-08-02 22:14:06 -03:00