cabal-version:      3.0
name:               effectful-postgresql
version:            0.1.0.0
synopsis:
  effectful support for mid-level PostgreSQL operations.
description:
  See the README for an overview, or the documentation in 'Effectful.PostgreSQL'.
license:            BSD-3-Clause
license-file:       LICENSE
author:             Frederick Pringle
maintainer:         frederick.pringle@fpringle.com
copyright:          Copyright(c) Frederick Pringle 2025
homepage:           https://github.com/fpringle/effectful-postgresql
build-type:         Simple
category:           Database
extra-doc-files:    README.md
                    CHANGELOG.md

tested-with:
    GHC == 8.8.4
  , GHC == 8.10.7
  , GHC == 9.0.2
  , GHC == 9.2.4
  , GHC == 9.2.8
  , GHC == 9.4.2
  , GHC == 9.4.5
  , GHC == 9.6.1
  , GHC == 9.6.7
  , GHC == 9.8.2
  , GHC == 9.10.2

flag enable-pool
  description: Enable support for connection pools using unliftio-pool.
               You can disable this for a lighter dependency footprint if
               you don't need support for connection pools.
  default: True
  manual: False

common warnings
  ghc-options: -Wall -Wno-unused-do-bind -Wunused-packages

  if flag(enable-pool)
    cpp-options: -DPOOL

common deps
  build-depends:
    , base >= 4 && < 5
    , effectful-core >= 2.3 && < 2.6
    , effectful-th >= 1.0.0.1 && < 1.0.1
    , postgresql-simple >= 0.7 && < 0.8

  if flag(enable-pool)
    build-depends:
      , unliftio-pool >= 0.4.1 && < 0.5

common extensions
  default-extensions:
    DataKinds
    FlexibleContexts
    GADTs
    LambdaCase
    RankNTypes
    ScopedTypeVariables
    TypeApplications
    TypeFamilies
    TypeOperators

library
  import:
      warnings
    , deps
    , extensions
  exposed-modules:
      Effectful.PostgreSQL
      Effectful.PostgreSQL.Connection
  if flag(enable-pool)
    exposed-modules:
      Effectful.PostgreSQL.Connection.Pool
  -- other-extensions:
  hs-source-dirs:   src
  default-language: Haskell2010
