database-id-class: Class for types with a database id

[ bsd3, database, library ] [ Propose Tags ]

Class for types with a database id

[Skip to Readme]


[Index] [Quick Jump]


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


  • No Candidates
Versions [RSS],
Change log
Dependencies aeson, base (>=4.11 && <4.14) [details]
License BSD-3-Clause
Copyright 2019 Obsidian Systems LLC
Author Obsidian Systems LLC
Category Database
Uploaded by abrar at 2019-07-21T07:34:11Z
Distributions NixOS:
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 1042 total (7 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 database-id-class-

[back to package description]


This package defines a (parametric) data type Id a used to refer to the primary key of values of type a in a database.

newtype Id a = Id { unId :: IdData a }

Here, IdData is a type family associated with the HasId class:

class HasId a where
  type IdData a :: *
  type IdData a = Int64

It defaults to Int64 because that tends to be the type you want for tables with an autoincrement primary key.