polytropos-rel8: rel8 Rel8able table schemas and queries over polytropos open rows

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

High-level type-safe PostgreSQL database mapping connecting polytropos open rows to Oliver Charles' rel8 framework.

Exposes Polytropos.Rel8.PolyRow, a higher-kinded Rel8.Rel8able schema representation whose columns are derived directly from the row's type-level field specification into an HProduct tree. Conversions between rel8's columnar representation and the flat Data.Primitive.SmallArray.SmallArray payload execute slot-by-slot in row order without intermediate tuples or arity limits.

Start at the front door module Polytropos.Rel8 for complete documentation, schema definitions, and worked query examples.


[Skip to Readme]

Modules

  • Polytropos
    • Polytropos.Rel8

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0.2
Change log CHANGELOG.md
Dependencies base (>=4.14 && <5), polytropos-core (>=0.1 && <0.2), polytropos-plugin (>=0.1 && <0.2), primitive (>=0.7 && <0.10), rel8 (>=1.8 && <1.9), rel8-internal (>=1.8 && <1.9), text (>=1.2 && <2.2) [details]
License (EUPL-1.2 OR Apache-2.0)
Author Nadia Yvette Chambers
Maintainer nadia.yvette.chambers@ik.me
Uploaded by nyc at 2026-10-21T21:34:35Z
Category Database, PostgreSQL
Home page https://github.com/NadiaYvette/polytropos
Bug tracker https://github.com/NadiaYvette/polytropos/issues
Source repo head: git clone https://github.com/NadiaYvette/polytropos(packages/polytropos-rel8)
Distributions
Downloads 3 total (3 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2026-10-21 [all 1 reports]

Readme for polytropos-rel8-0.1.0.2

[back to package description]

polytropos-rel8

High-level type-safe PostgreSQL database mapping connecting polytropos open rows to Oliver Charles' rel8 framework.

Overview

polytropos-rel8 exposes PolyRow, a higher-kinded Rel8able schema representation whose columns are derived directly from the row's type-level field specification into an HProduct tree.

Features

  • PolyRow Table Schema: Higher-kinded record schema representation implementing Rel8able.
  • Zero-Tuple Mapping: Converts directly between rel8 columnar tables and SmallArray row representations without intermediate Haskell tuples.
  • Sub-Row Projection: Slices wide SQL tables into compact view records via projectRecord.

Quick Example

{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeApplications #-}
{-# OPTIONS_GHC -fplugin=Polytropos.Plugin #-}

import Data.Int (Int64)
import Rel8
import Polytropos
import Polytropos.Rel8

type AccountRow = '["id" ':= Int64, "balance" ':= Double]
type AccountTable = PolyRow AccountRow

-- Lift an open record directly into a Rel8 SQL expression row:
rec :: Record AccountRow
rec = REC { id = 42 :: Int64, balance = 1000.50 :: Double }

sqlExpr :: AccountTable Expr
sqlExpr = litRecord rec

License

Dual-licensed under EUPL-1.2 OR Apache-2.0.