Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#27 DBDirect generates uncompilable code

open
nobody
None
7
2005-02-14
2005-02-14
John Goerzen
No

Hi,

Most of the code DBDirect generates works fine.
However, the attached file doesn't build; the error is:

./DBMFGPro/Exr_rate.hs:4:
Multiple declarations of `DBMFGPro.Exr_rate.exr_rate'
./DBMFGPro/Exr_rate.hs:28
./DBMFGPro/Exr_rate.hs:102

And indeed, it looks like ghc has a valid complaint here.

Discussion

  • John Goerzen
    John Goerzen
    2005-02-14

    Erroneous code

     
    Attachments
  • Bjorn Bringert
    Bjorn Bringert
    2005-02-14

    Logged In: YES
    user_id=123762

    The problem seems to be that when you have a field with the
    same name as the name of the table it is in, DBDirect
    generates colliding identifiers for them. It should be
    simple fix to the functions at the end of
    src/Database/HaskellDB/DBSpec/DBInfo.hs

    The functions for making names unique seem to be somewhat
    overcomplicated, anyone care to fix them?

     
  • Bjorn Bringert
    Bjorn Bringert
    2005-02-14

    • priority: 5 --> 7