poppy-codegen: Schema builder and Client codegen for Poppy

[ bsd3, database, library ] [ Propose Tags ] [ Report a vulnerability ]

Write a Schema, generate table types and a Client, and compare that Schema to live Postgres.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 1.0.0
Change log CHANGELOG.md
Dependencies base (>=4.17 && <4.21), containers (>=0.6 && <0.8), directory (>=1.3 && <1.4), filepath (>=1.4 && <1.6), poppy (>=1.0 && <1.1), postgresql-simple (>=0.6 && <0.8), text (>=2.0 && <2.2) [details]
Tested with ghc ==9.4.8, ghc ==9.10.3
License BSD-3-Clause
Copyright 2023–2026 Henrik Nerdrum
Author Henrik Nerdrum
Maintainer henrik.nerdrum@gmail.com
Uploaded by hnerdrum at 2026-10-10T07:28:07Z
Category Database
Home page https://github.com/hnerdrum/poppy#readme
Bug tracker https://github.com/hnerdrum/poppy/issues
Source repo head: git clone https://github.com/hnerdrum/poppy
Distributions
Downloads 2 total (2 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for poppy-codegen-1.0.0

[back to package description]

poppy-codegen

The code generator for Poppy, a Postgres ORM for Haskell. You describe tables with Poppy.Codegen.Schema, then call generate from an executable to write table types and a client for the poppy runtime.

module Main (main) where

import Poppy.Codegen.CLI (generate)
import TaskSchema (taskSchema)

main :: IO ()
main = generate "src/Schema" taskSchema

generate takes an output directory and the schema value. The directory sets the module prefix, so src/Schema produces modules under Schema, with the clients in src/Schema/Client.

The executable accepts the following flags:

Flag Purpose
(none) Validate Schemas and write generated files
--check Fail if generated files on disk differ from Codegen
--check-schema Compare Schema to live Postgres database
--list Print output paths without writing

--check-schema reads DATABASE_URL. Pass --database-url URL to override it. The check fails if tables, columns, or keys do not match the schema.

The repository README shows the full setup. For working code, see examples/task/ and examples/blog/. The guides cover the schema builder and migrations in more depth.