polytropos-persistent: persistent database marshalling and entity wrappers for polytropos

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

Integration bridging polytropos open records with the Yesod ecosystem's persistent relational database library.

Provides fast zero-tuple marshalling of records to and from [Database.Persist.Class.PersistField.PersistValue] rows via Polytropos.Persistent.PersistRow (Polytropos.Persistent.toPersistFieldsRecord, Polytropos.Persistent.fromPersistValuesRecord), whole-record column storage as Database.Persist.Class.PersistField.PersistList via Database.Persist.Class.PersistField.PersistField and Database.Persist.Sql.Class.PersistFieldSql, and entity wrappers via Polytropos.Persistent.PolyRowEntity.

Start at the front door module Polytropos.Persistent for complete documentation, schema mappings, and worked examples.


[Skip to Readme]

Modules

[Index] [Quick Jump]

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), persistent (>=2.14 && <2.19), polytropos-core (>=0.1 && <0.2), polytropos-plugin (>=0.1 && <0.2), 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:31Z
Category Database
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-persistent)
Distributions
Downloads 3 total (3 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-10-21 [all 1 reports]

Readme for polytropos-persistent-0.1.0.2

[back to package description]

polytropos-persistent

Yesod persistent relational database marshalling and entity wrappers for polytropos open records.

Overview

polytropos-persistent connects open records with the Yesod ecosystem's persistent library, providing fast zero-tuple marshalling to and from [PersistValue] rows.

Features

  • PersistRow: Fast conversion between open records and [PersistValue] lists (toPersistFieldsRecord, fromPersistValuesRecord).
  • PolyRowEntity: Type-safe wrapper for database entities storing Key alongside open records.
  • Whole-Record Column Storage: Direct PersistField and PersistFieldSql serialization for embedded records.

Quick Example

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

import Database.Persist
import Data.Text (Text)
import Polytropos
import Polytropos.Persistent

type PersonRow = Record '["name" ':= Text, "age" ':= Int]

person :: PersonRow
person = REC { name = "Alice", age = 30 }

-- Zero-tuple marshalling directly into persistent values:
vals :: [PersistValue]
vals = toPersistFieldsRecord person

License

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