dryvPacks

@dryv/persistent-modelsv0.1.0

Haskell Persistent models with explicit keys, unique constraints and foreign-key lifecycle.

Persistent ModelsPersistenceUnitPublished 7 days ago2 downloads

dryv pack add @dryv/persistent-models
1016 BRaw ↗
yaml
version: dryv.pack/v1alpha1
key: unit.persistence.persistent-models
layout: unit
package:
  name: dryv-persistent-models

source: templates

info:
  title: Persistent Models
  version: 0.1.0
  description: Generates Persistent 2.18 entity definitions and an aggregate migration module.

  purpose: persistence
  summary: Haskell Persistent models with explicit keys, unique constraints and foreign-key lifecycle.
  languages: [haskell]
  frameworks: [persistent]
  tags: [persistence, orm, database, haskell]

plugins:
  - name: jinja
    extensions: [.j2]

selections:
  entities:
    subject: schema
    filter:
      all: { role: entity }
    scope: each

templates:
  entity:
    $ref: "#/selections/entities"
    output:
      name: $(group.name.snake)_$(subject.name.snake)
      symbol: $(group.name.pascal)$(subject.name.pascal)Entity
    imports:
      - $ref: "#/templates/entity"

  registry:
    exports:
      - $ref: "#/templates/entity"

provides:
  schema.persistence:
    $ref: "#/templates/entity"