testcontainers-postgresql: Testcontainers integration for PostgreSQL

[ codecs, library, mit, postgresql ] [ Propose Tags ] [ Report a vulnerability ]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.0.1, 0.0.1.1
Dependencies base (>=4.11 && <5), testcontainers (>=0.5.1 && <0.6), text (>=1.2 && <3) [details]
License MIT
Copyright (c) 2025, Nikita Volkov
Author Nikita Volkov <nikita.y.volkov@mail.ru>
Maintainer Nikita Volkov <nikita.y.volkov@mail.ru>
Category PostgreSQL, Codecs
Home page https://github.com/nikita-volkov/testcontainers-postgresql
Bug tracker https://github.com/nikita-volkov/testcontainers-postgresql/issues
Source repo head: git clone https://github.com/nikita-volkov/testcontainers-postgresql
Uploaded by NikitaVolkov at 2025-09-08T12:04:12Z
Distributions
Downloads 5 total (5 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2025-09-08 [all 1 reports]

Readme for testcontainers-postgresql-0.0.1

[back to package description]

testcontainers-postgresql

Hackage Continuous Haddock

A Haskell library providing Testcontainers integration for PostgreSQL databases. This library simplifies running PostgreSQL containers for testing purposes, with support for various PostgreSQL versions and authentication methods.

Features

  • Multiple PostgreSQL Versions: Support for PostgreSQL versions 9 through 17
  • Flexible Authentication: Choose between trust-based authentication or username/password credentials
  • Log Forwarding: Optional log forwarding to the console for debugging

Quick Start

import TestcontainersPostgresql
import TestcontainersPostgresql.Configs.Config
import TestcontainersPostgresql.Configs.Distro
import TestcontainersPostgresql.Configs.Auth

main :: IO ()
main = do
  let config = Config
        { forwardLogs = True
        , distro = Distro16  -- PostgreSQL 16
        , auth = TrustAuth   -- Trust-based authentication
        }

  run config $ \(host, port) -> do
    putStrLn $ "PostgreSQL is running at " ++ show host ++ ":" ++ show port
    -- Your test code here
    -- Connect to PostgreSQL using host and port