cabal-version:       2.4
name:                postgresql-simple-named
version:             0.0.0.0
synopsis:            Implementation of named parameters for `postgresql-simple` library
description:
    Implementation of named parameters for @postgresql-simple@ library.
    .
    Here is an exaple of how it could be used in your code:
    .
    > queryNamed [sql|
    >     SELECT *
    >     FROM table
    >     WHERE foo = ?foo
    >       AND bar = ?bar
    >       AND baz = ?foo
    > |] [ "foo" =? "fooBar"
    >    , "bar" =? "barVar"
    >    ]

homepage:            https://github.com/Holmusk/postgresql-simple-named
bug-reports:         https://github.com/Holmusk/postgresql-simple-named/issues
license:             MPL-2.0
license-file:        LICENSE
author:              Dmitrii Kovanikov, Veronika Romashkina
maintainer:          Holmusk <tech@holmusk.com>
copyright:           2019 Holmusk
category:            Database, PostgreSQL
build-type:          Simple
extra-doc-files:     README.md
                   , CHANGELOG.md
tested-with:         GHC == 8.4.4
                   , GHC == 8.6.5

source-repository head
  type:                git
  location:            https://github.com/Holmusk/postgresql-simple-named.git

common common-options
  build-depends:       base >= 4.11 && < 4.13

  ghc-options:         -Wall
                       -Wincomplete-uni-patterns
                       -Wincomplete-record-updates
                       -Wcompat
                       -Widentities
                       -Wredundant-constraints
                       -fhide-source-paths
                       -Wmissing-export-lists
                       -Wpartial-fields

  default-language:    Haskell2010
  default-extensions:  ConstraintKinds
                       DeriveGeneric
                       GeneralizedNewtypeDeriving
                       InstanceSigs
                       KindSignatures
                       LambdaCase
                       OverloadedStrings
                       RecordWildCards
                       ScopedTypeVariables
                       StandaloneDeriving
                       TupleSections
                       TypeApplications
                       ViewPatterns

library
  import:              common-options
  hs-source-dirs:      src
  exposed-modules:     PgNamed
  build-depends:       bytestring ^>= 0.10.8
                     , mtl ^>= 2.2
                     , postgresql-simple ^>= 0.6.2
                     , text ^>= 1.2

test-suite postgresql-simple-named-test
  import:              common-options
  type:                exitcode-stdio-1.0
  hs-source-dirs:      test
  main-is:             Spec.hs

  build-depends:       bytestring
                     , hspec >= 2.6 && < 2.8
                     , postgresql-simple-named
                     , postgresql-simple
                     , resource-pool ^>= 0.2.3.2
                     , transformers

  ghc-options:         -threaded -rtsopts -with-rtsopts=-N

test-suite postgresql-simple-named-doctest
  import:              common-options
  type:                exitcode-stdio-1.0
  hs-source-dirs:      test
  main-is:             Doctest.hs

  build-depends:       doctest
                     , Glob

  ghc-options:         -threaded