packages feed

postgresql-tx-squeal-compat-simple (empty) → 0.1.0.0

raw patch · 5 files changed

+129/−0 lines, 5 filesdep +basedep +postgresql-simpledep +postgresql-tx-squeal

Dependencies added: base, postgresql-simple, postgresql-tx-squeal

Files

+ CHANGELOG.md view
@@ -0,0 +1,5 @@+# Change log++## 0.1.0.0++* Initial release
+ LICENSE.md view
@@ -0,0 +1,30 @@+Copyright SimSpace (c) 2020++All rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions are met:++    * Redistributions of source code must retain the above copyright+      notice, this list of conditions and the following disclaimer.++    * Redistributions in binary form must reproduce the above+      copyright notice, this list of conditions and the following+      disclaimer in the documentation and/or other materials provided+      with the distribution.++    * Neither the name of SimSpace nor the names of other+      contributors may be used to endorse or promote products derived+      from this software without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ package.yaml view
@@ -0,0 +1,27 @@+name:                postgresql-tx-squeal-compat-simple+version:             0.1.0.0+github:              "simspace/postgresql-tx"+license:             BSD3+license-file:        LICENSE.md+author:              "Jason Shipman"+maintainer:          "jasonpshipman@gmail.com"+copyright:           "2020 SimSpace"+synopsis:            Connection interop from postgresql-simple connections to postgresql-libpq connections.+category:            Database+description:         Please see the README on GitHub at <https://github.com/simspace/postgresql-tx#readme>++extra-source-files:+- CHANGELOG.md+- LICENSE.md+- package.yaml++ghc-options:+  - -Wall++dependencies:+- base >= 4.7 && < 5+- postgresql-simple >= 0.6.2 && < 0.7+- postgresql-tx-squeal >= 0.2.0.0 && < 0.3++library:+  source-dirs: src
+ postgresql-tx-squeal-compat-simple.cabal view
@@ -0,0 +1,43 @@+cabal-version: 1.12++-- This file has been generated from package.yaml by hpack version 0.31.2.+--+-- see: https://github.com/sol/hpack+--+-- hash: 9e41fa7e1ce0b7332c8127c01fcc669021bd3a67e11cfcf296209d780df16fcc++name:           postgresql-tx-squeal-compat-simple+version:        0.1.0.0+synopsis:       Connection interop from postgresql-simple connections to postgresql-libpq connections.+description:    Please see the README on GitHub at <https://github.com/simspace/postgresql-tx#readme>+category:       Database+homepage:       https://github.com/simspace/postgresql-tx#readme+bug-reports:    https://github.com/simspace/postgresql-tx/issues+author:         Jason Shipman+maintainer:     jasonpshipman@gmail.com+copyright:      2020 SimSpace+license:        BSD3+license-file:   LICENSE.md+build-type:     Simple+extra-source-files:+    CHANGELOG.md+    LICENSE.md+    package.yaml++source-repository head+  type: git+  location: https://github.com/simspace/postgresql-tx++library+  exposed-modules:+      Database.PostgreSQL.Tx.Squeal.Compat.Simple+  other-modules:+      Paths_postgresql_tx_squeal_compat_simple+  hs-source-dirs:+      src+  ghc-options: -Wall+  build-depends:+      base >=4.7 && <5+    , postgresql-simple >=0.6.2 && <0.7+    , postgresql-tx-squeal >=0.2.0.0 && <0.3+  default-language: Haskell2010
+ src/Database/PostgreSQL/Tx/Squeal/Compat/Simple.hs view
@@ -0,0 +1,24 @@+{-# LANGUAGE BlockArguments #-}+module Database.PostgreSQL.Tx.Squeal.Compat.Simple+  ( withSquealConnection+  ) where++import Database.PostgreSQL.Tx.Squeal.Internal (SquealConnection(UnsafeSquealConnection))+import qualified Control.Concurrent as Concurrent+import qualified Database.PostgreSQL.Simple as Simple+import qualified Database.PostgreSQL.Simple.Internal as Simple.Internal++-- | Used in the 'Database.PostgreSQL.Tx.Squeal.Internal.SquealEnv' to specify+-- the 'Database.PostgreSQL.Tx.Squeal.Internal.SquealConnection' from a+-- @postgresql-simple@ 'Simple.Connection'.+--+-- 'Database.PostgreSQL.Tx.Squeal.Internal.mkSquealConnection' should be+-- preferred over this function if you are only working with+-- @postgresql-libpq@ connections.+--+-- @since 0.1.0.0+withSquealConnection :: Simple.Connection -> (SquealConnection -> IO a) -> IO a+withSquealConnection conn f = do+  f $ UnsafeSquealConnection+    $ Concurrent.readMVar+    $ Simple.Internal.connectionHandle conn