cabal-version: 3.0
name: postgresql-connection-string
version: 0.1.0.2
category: Database, PostgreSQL
synopsis: PostgreSQL connection string type, parser and builder
description:
A library for parsing and constructing PostgreSQL connection strings (URIs and keyword/value format).
Supports the full PostgreSQL connection URI format as specified in
<https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING the PostgreSQL documentation>,
including:
* User and password authentication
* Single and multiple host specifications with optional ports
* Database name specification
* Connection parameters as query string
* Percent-encoding for special characters
The library provides both parsing (from Text to structured representation) and
rendering (back to connection string format, either as URI or keyword/value pairs).
homepage: https://github.com/nikita-volkov/postgresql-connection-string
bug-reports: https://github.com/nikita-volkov/postgresql-connection-string/issues
author: Nikita Volkov <nikita.y.volkov@mail.ru>
maintainer: Nikita Volkov <nikita.y.volkov@mail.ru>
copyright: (c) 2025, Nikita Volkov
license: MIT
license-file: LICENSE
extra-source-files:
README.md
extra-doc-files:
CHANGELOG.md
source-repository head
type: git
location: https://github.com/nikita-volkov/postgresql-connection-string
common base
default-language: Haskell2010
default-extensions:
ApplicativeDo
Arrows
BangPatterns
BlockArguments
ConstraintKinds
DataKinds
DefaultSignatures
DeriveAnyClass
DeriveFoldable
DeriveFunctor
DeriveGeneric
DeriveTraversable
DerivingVia
DuplicateRecordFields
EmptyDataDecls
FlexibleContexts
FlexibleInstances
FunctionalDependencies
GADTs
GeneralizedNewtypeDeriving
LambdaCase
LiberalTypeSynonyms
MultiParamTypeClasses
MultiWayIf
NamedFieldPuns
NoImplicitPrelude
NoMonomorphismRestriction
NumericUnderscores
OverloadedStrings
PatternGuards
QuasiQuotes
RankNTypes
RecordWildCards
RoleAnnotations
ScopedTypeVariables
StandaloneDeriving
StrictData
TupleSections
TypeApplications
TypeFamilies
TypeOperators
ViewPatterns
common test
import: base
ghc-options:
-threaded
-with-rtsopts=-N
library
import: base
hs-source-dirs: src/library
exposed-modules:
PostgresqlConnectionString
other-modules:
PostgresqlConnectionString.Charsets
PostgresqlConnectionString.Parsers
PostgresqlConnectionString.Types
PostgresqlConnectionString.Types.Gens
build-depends:
QuickCheck >=2.14 && <2.16,
charset ^>=0.3.12,
containers >=0.6 && <0.9,
megaparsec >=9.2.1 && <10.0,
postgresql-connection-string:percent-encoding,
postgresql-connection-string:platform,
text >=1.2 && <3,
text-builder >=1 && <1.1,
-- Replacement of the "base" library for all the sublibs here.
-- Covers such things as Prelude and shared utils.
library platform
import: base
visibility: private
hs-source-dirs: src/platform
exposed-modules:
Platform.Prelude
build-depends:
base >=4.13 && <5,
bytestring >=0.10 && <0.13,
hashable >=1.2 && <2,
text >=1.2 && <3,
text-builder >=1 && <1.1,
library percent-encoding
import: base
visibility: private
hs-source-dirs: src/percent-encoding
exposed-modules:
PercentEncoding
other-modules:
PercentEncoding.Charsets
PercentEncoding.MonadPlus
PercentEncoding.Parsers
PercentEncoding.TextBuilders
PercentEncoding.Utf8CharView
build-depends:
base >=4.13 && <5,
bytestring >=0.10 && <0.13,
charset ^>=0.3.12,
megaparsec >=9.2.1 && <10.0,
postgresql-connection-string:platform,
text >=1.2 && <3,
text-builder >=1 && <1.1,
test-suite library-tests
import: test
type: exitcode-stdio-1.0
hs-source-dirs: src/library-tests
main-is: Main.hs
build-depends:
QuickCheck >=2.14 && <2.16,
containers >=0.6 && <0.9,
hspec ^>=2.11.12,
postgresql-connection-string,
postgresql-connection-string:platform,
quickcheck-classes >=0.6.5 && <0.7,
text >=1.2 && <3,