groundhog icon indicating copy to clipboard operation
groundhog copied to clipboard

Key on embedded field

Open yaitskov opened this issue 5 years ago • 0 comments

data T1 = T1 { _t1_F1 :: Int }

data T2 = T2 { _t2_F2 :: T1 }

mkPersist(defaultCodegenConfig { namingStyle = escapeUnderscore })
  [groundhog|
definitions:
  - entity: T2
    dbName: t2
    autoKey: null
    keys:
      - name: Xxx
        default: true
    constructors:
      - name: T2
        uniques:
          - name: Xxx
            type: primary
            fields: [_t2_F2._t1_F1]
|]

    Exception when trying to run compile-time code:
      Not found field with name "_t2_F2._t1_F1"

yaitskov avatar Oct 26 '20 14:10 yaitskov