1

I have a problem when it comes on compiling my code on esqueleto. For some reason my IDE which is fpcomplete says that there is now an error. But, when I build it it says the My ModelId is unknown.

Here is my code:

qryStrainsList ::  SqlBackend -> IO [RawWeedsInfo]
qryStrainsList backend = (flip runReaderT) backend
    $ select 
    $ from $ \(strains `LeftOuterJoin` strainsInfo) -> do
         on $ (strains ^. StrainsId) ==.  strainsInfo ^. StrainsAdditionalInformationStrainId
         return ( strains   ^. StrainsId
            , strains   ^. StrainsName
            , strains ^. StrainsStrainType
            , strains ^. StrainsDescription
            , strainsInfo ^. StrainsAdditionalInformationIncludeType
            , strainsInfo ^. StrainsAdditionalInformationExcludeType
            , strainsInfo ^. StrainsAdditionalInformationSymptoms
            , strainsInfo ^. StrainsAdditionalInformationConditions
            , strains ^. StrainsFlavor
            , strains ^. StrainsThcLevel
            , strains ^. StrainsCbdLevel
            , strains ^. StrainsPhotoPeriod
            , strains ^. StrainsBreeders
      )

The error message is this:

The code threw an exception : 
IOException: user error (Postgresql.withStmt': 
    bad result status FatalError (
    ("PGRES_FATAL_ERROR","ERROR:  
           zero-length delimited identifier at or near \"\"\"\"\nLINE 
    1: SELECT \"strains\".\"\", \"strains\".\"name\", \"strains\".\"strain_typ...\n                         ^\n")))

Maybe this will also help: I'm using FpComplete as an IDE with Esqueleto 2.0.1 (This was the version supported by the IDE, I think.)

Thanks.

MooseMan55
  • 524
  • 2
  • 6
  • 21
Ryan Monreal
  • 587
  • 5
  • 16
  • when you execute the sql, check the yesod console output for the full text of the sql statement and its parameters. cut and paste into a document, edit out the quotes and try to execute it directly in the psql command line. Maybe will help give you insight as to the specific problem. – Bzzt Jul 10 '15 at 20:28

0 Answers0