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 [faq] 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 Sun Jul 21 07:34:11 UTC 2019
Distributions NixOS:0.1.0.1
Downloads 89 total (25 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs uploaded by user
Build status unknown [no reports yet]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


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.