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]
Versions [RSS] [faq],
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:
Downloads 777 total (7 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs uploaded by user
Build status unknown [no reports yet]


[Index] [Quick Jump]


Maintainer's Corner

For package maintainers and hackage trustees


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.