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

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

Class for types with a database id


[Skip to Readme]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.0.1
Change log CHANGELOG.md
Dependencies aeson, base (>=4.11 && <4.14) [details]
License BSD-3-Clause
Copyright 2019 Obsidian Systems LLC
Author Obsidian Systems LLC
Maintainer maintainer@obsidian.systems
Category Database
Uploaded by abrar at 2019-07-21T07:34:11Z
Distributions NixOS:0.1.0.1
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 1072 total (13 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-0.1.0.1

[back to package description]

database-id-class

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.