@hackage valiant0.1.0.0

Compile-time checked SQL for Haskell, runtime library

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.