| CARVIEW |
Select Language
HTTP/1.1 200 OK
Connection: keep-alive
Server: nginx/1.24.0 (Ubuntu)
Content-Type: text/html; charset=utf-8
Cache-Control: public, max-age=300
Content-Encoding: gzip
Via: 1.1 varnish, 1.1 varnish
Accept-Ranges: bytes
Age: 0
Date: Tue, 20 Jan 2026 05:08:15 GMT
X-Served-By: cache-dfw-kdal2120079-DFW, cache-bom-vanm7210068-BOM
X-Cache: MISS, MISS
X-Cache-Hits: 0, 0
X-Timer: S1768885696.561846,VS0,VE302
Vary: Accept, Accept-Encoding
transfer-encoding: chunked
mu-persistent: Utilities for interoperation between Mu and Persistent
mu-persistent: Utilities for interoperation between Mu and Persistent
Downloads
- mu-persistent-0.3.1.0.tar.gz [browse] (Cabal source package)
- Package description (revised from the package)
Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
| Versions [RSS] | 0.1.0.0, 0.2.0.0, 0.3.0.0, 0.3.1.0 |
|---|---|
| Dependencies | base (>=4.12 && <5), monad-logger (>=0.3 && <0.4), mu-schema (>=0.3 && <0.4), persistent (>=2.10 && <3), resource-pool (>=0.2 && <0.3), resourcet (>=1.2 && <2), transformers (>=0.5 && <0.6) [details] |
| License | Apache-2.0 |
| Copyright | Copyright © 2019-2020 <https://47deg.com 47 Degrees> |
| Author | Flavio Corpa, Alejandro Serrano |
| Maintainer | flavio.corpa@47deg.com |
| Uploaded | by AlejandroSerrano at 2020-11-19T09:00:03Z |
| Revised | Revision 1 made by AlejandroSerrano at 2023-01-06T10:00:38Z |
| Category | Network |
| Home page | https://higherkindness.io/mu-haskell/db/ |
| Bug tracker | https://github.com/higherkindness/mu-haskell/issues |
| Source repo | head: git clone https://github.com/higherkindness/mu-haskell |
| Distributions | |
| Downloads | 1149 total (18 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 mu-persistent-0.3.1.0
[back to package description]mu-persistent
This are some utilities to integrate easily with persistent while using Mu.
Usage
Say you have for example, the following Entity:
mkPersist sqlSettings [persistLowerCase|
Person
name T.Text
age Int32
deriving Show Generic
|]
But in your proto3, the Person message is defined as:
message PersonRequest {
int64 identifier = 1;
}
message Person {
PersonRequest pid = 1;
string name = 2;
int32 age = 3;
}
How can you derive the correct ToSchema instances that Mu needs to work with that nested Id that belongs to another message? 🤔
You can use WithEntityNestedId, along with a custom field mapping and DerivingVia to do all the work for you!
{-# language DerivingVia #-}
type PersonFieldMapping
= '[ "personAge" ':-> "age", "personName" ':-> "name" ]
deriving via (WithEntityNestedId "Person" PersonFieldMapping (Entity Person))
instance ToSchema Maybe PersistentSchema "Person" (Entity Person)
For a more complete example of usage, please check the example with persistent.