homepage: ''
changelog-type: markdown
hash: da5cc7feedb9686602f0af03b2e39ab8d229ddecbcd466516f11c8f7c89512d1
test-bench-deps: {}
maintainer: maintainer@obsidian.systems
synopsis: HasId/Groundhog interop
changelog: |
  # Revision history for database-id-groundhog

  ## 0.1.0.1

  * Add readme

  ## 0.1.0.0

  * Initial release. Defines the DefaultKeyId class, connecting groundhog IDs to HasId instances, and some convenience functions for going back and forth between the two.
  * Add PersistField instances handy for storing `Id`s in the database (e.g., as foreign keys).
  * Add Template Haskell for generating IdData and DefaultKeyId instances
basic-deps:
  base: ! '>=4.11 && <4.13'
  database-id-class: -any
  groundhog: <=0.7.0.3
  aeson: -any
  template-haskell: -any
all-versions:
- 0.1.0.1
author: Obsidian Systems LLC
latest: 0.1.0.1
description-type: markdown
description: |
  database-id-groundhog
  ---------------------

  This package provides support for groundhog database interaction to database-id-class, in particular, the functions

      toId :: DefaultKeyId a => DefaultKey a -> Id a
      fromId :: DefaultKeyId a => Id a -> DefaultKey a

  which convert back and forth between the Id and groundhog's DefaultKey representation according to the instances of
  the `DefaultKeyId` class.

  It also includes the Template Haskell macro `makeDefaultKeyIdInt64` which, given the `Name` of a datatype and the `Name` of
  the data constructor for its groundhog-generated key datatype (typically named the same as the type, with the suffix
  "Key"), produces an instance of DefaultKeyId in cases where the primary key is an `Int64`.

  Similar to this, `makeDefaultKeyIdSimple` exists for cases where all that is required to go between `DefaultKey a` and
  `IdData a` is to remove (or put back) Groundhog's type-specific Key data constructor.

  It also includes instances of `PersistField` and `PrimitivePersistField` for `Id a`.
license-name: BSD-3-Clause

Update from Hackage at 2019-07-21T07:45:27Z
Update from Hackage at 2019-07-21T07:45:27Z
