valiant: Compile-time checked SQL for Haskell, runtime library

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

Runtime library for valiant. Provides the Statement type, binary format codecs, query execution functions, and re-exports from pg-wire (the underlying PostgreSQL wire protocol driver).


[Skip to Readme]

Flags

Manual Flags

NameDescriptionDefault
werror

Enable -Werror for development builds.

Disabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.0.1
Change log CHANGELOG.md
Dependencies aeson (>=2.1 && <2.3), async (>=2.2 && <2.3), base (>=4.17 && <5), bytestring (>=0.11 && <0.13), containers (>=0.6 && <0.8), deepseq (>=1.4 && <1.6), hashable (>=1.4 && <1.6), network (>=3.1 && <3.3), pg-wire (>=0.2 && <0.3), scientific (>=0.3 && <0.4), text (>=2.0 && <2.2), time (>=1.12 && <1.15), uuid-types (>=1.0 && <1.1), vector (>=0.13 && <0.14) [details]
Tested with ghc ==9.10.3
License BSD-3-Clause
Author Josh Burgess
Maintainer joshburgess.webdev@gmail.com
Uploaded by joshburgess at 2026-04-30T12:29:05Z
Category Database
Home page https://github.com/joshburgess/valiant
Bug tracker https://github.com/joshburgess/valiant/issues
Source repo head: git clone https://github.com/joshburgess/valiant(runtime)
Distributions
Reverse Dependencies 8 direct, 0 indirect [details]
Downloads 9 total (9 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2026-04-30 [all 1 reports]

Readme for valiant-0.1.0.1

[back to package description]

valiant

Compile-time checked SQL for Haskell. Runtime library.

What this package gives you

  • The Statement type and query execution functions: execute, fetchOne, fetchAll, fetchAllVec, fetchAllUnboxed, server-side cursors (withCursor, fetchBatch, fetchAllCursor, executeWithFold).
  • Pipelined batch execution (runPipeline) with an Applicative interface for combining independent reads into one round-trip.
  • Binary codecs for all common PostgreSQL types: numeric and text primitives, time, UUID, JSON / JSONB, hstore, inet / cidr / macaddr, point, ranges, arrays, composites, enums.
  • COPY in / out (text, CSV, binary), large objects, LISTEN / NOTIFY, advisory locks, transactions (with savepoints and read-only mode), prepared statements with statement caching.
  • Re-exports from pg-wire: connection pool, TLS, authentication, error types.

Compile-time validation

The Statement values you execute typically come from the Valiant.Plugin GHC source plugin (in the valiant-plugin package). The plugin checks parameter and result types against a .valiant/ cache produced by the valiant-cli tool, which talks to a live PostgreSQL database via PREPARE / DESCRIBE.

You can also build Statement values manually with mkStatement, which skips the compile-time check.

Installation

cabal install valiant

Documentation

License

BSD-3-Clause. See LICENSE.