packages feed

persistent-postgresql 2.13.6 → 2.13.6.1

raw patch · 4 files changed

+23/−8 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

ChangeLog.md view
@@ -1,11 +1,18 @@ # Changelog for persistent-postgresql -## 2.13.6 (unreleased)+## 2.13.6.1 +* [#1518](https://github.com/yesodweb/persistent/pull/1518)+    * Normalize postgres type aliases to prevent noop migrations++## 2.13.6+ * [#1511](https://github.com/yesodweb/persistent/pull/1511)    * Add the `createPostgresqlPoolTailored` function to support creating      connection pools with a custom connection creation function.    * Expose `getServerVersion` and `createBackend` for user's convenience.+* [#1516](https://github.com/yesodweb/persistent/pull/1516)+   * Support postgresql-simple 0.7 and postgresql-libpq 0.10  ## 2.13.5.2 
Database/Persist/Postgresql.hs view
@@ -1103,7 +1103,15 @@ -- | Intelligent comparison of SQL types, to account for SqlInt32 vs SqlOther integer sqlTypeEq :: SqlType -> SqlType -> Bool sqlTypeEq x y =-    T.toCaseFold (showSqlType x) == T.toCaseFold (showSqlType y)+    let+        -- Non exhaustive helper to map postgres aliases to the same name. Based on+        -- https://www.postgresql.org/docs/9.5/datatype.html.+        -- This prevents needless `ALTER TYPE`s when the type is the same.+        normalize "int8"    = "bigint"+        normalize "serial8" = "bigserial"+        normalize v         = v+    in+        normalize (T.toCaseFold (showSqlType x)) == normalize (T.toCaseFold (showSqlType y))  findAlters     :: [EntityDef]@@ -1369,7 +1377,7 @@     , escapeC cname     ] --- | Get the SQL string for the table that a PeristEntity represents.+-- | Get the SQL string for the table that a PersistEntity represents. -- Useful for raw SQL queries. tableName :: (PersistEntity record) => record -> Text tableName = escapeE . tableDBName
persistent-postgresql.cabal view
@@ -1,5 +1,5 @@ name:            persistent-postgresql-version:         2.13.6+version:         2.13.6.1 license:         MIT license-file:    LICENSE author:          Felipe Lessa, Michael Snoyman <michael@snoyman.com>@@ -25,8 +25,8 @@                    , containers            >= 0.5                    , monad-logger          >= 0.3.25                    , mtl-                   , postgresql-simple     >= 0.6.1    && < 0.7-                   , postgresql-libpq      >= 0.9.4.2  && < 0.10+                   , postgresql-simple     >= 0.6.1    && < 0.8+                   , postgresql-libpq      >= 0.9.4.2  && < 0.11                    , resourcet             >= 1.1.9                    , resource-pool                    , string-conversions
test/EquivalentTypeTestPostgres.hs view
@@ -21,7 +21,7 @@  share [mkPersist sqlSettings, mkMigrate "migrateAll1"] [persistLowerCase| EquivalentType sql=equivalent_types-    field1 Int+    field1 Int    sqltype=bigint     field2 T.Text sqltype=text     field3 T.Text sqltype=us_postal_code     deriving Eq Show@@ -29,7 +29,7 @@  share [mkPersist sqlSettings, mkMigrate "migrateAll2"] [persistLowerCase| EquivalentType2 sql=equivalent_types-    field1 Int+    field1 Int    sqltype=int8     field2 T.Text     field3 T.Text sqltype=us_postal_code     deriving Eq Show