|
From: Marc W. <mar...@gm...> - 2006-03-20 17:34:58
|
> I once ran into a similar problem in ghci when I had an unneccessary
> "-lc" in the package configuration, and my libc.so was a linker script.
Thanks a lot.. It's working like a charm now..
I have some suggestions.. I don't know wether you've already thought
about this?
The example still use genericConnect (which seems to be dynConnnect
,now)...
One thing I checked for (because I had this problem some years ago using
different databases) is quoting that they use different quoting. It took
me some time to realize that this is not implemented (I've grepped the
whole source many times for ` and [. beeing used by MySQL and MS
Access. So by now it's not possible to use whitespaces in field names.
Databases have additional functions. Such as adding dates, random
numbers (what the hell there might be) String functions (might be done
in haskell.. What might be faster?).. Would be really unbeatable to
have some kind of abstraction here, too. Unfortunately I'm not familiar
enough with the code, yet.
I'm still trying to get everything to work.
Is this correct
myquery=do -- << query works find
t<-Q.table TblLang.languages
return t
main=do
t <- connect $ \db -> query db myquery
(\r -> (putStrLn.show) r!TblLang.iD) (GHC.List.head t) -- << here many errors after trying to only get field TblLang.iD
mapM_ (putStrLn . show) t -- showing all works fine
errors: (copied from vim)
test2.hs|34| 26:
|| No instance for (Select (Attr StoreDatabase.Languages.ID Int)
|| (IO ())
|| (IO a))
arising from use of `!' at test2.hs|34| 26
|| Probable fix:
|| add an instance declaration for (Select (Attr StoreDatabase.Languages.ID
|| Int)
|| (IO ())
|| (IO a))
|| In a lambda abstraction:
|| \ r -> ((putStrLn . show) r) ! StoreDatabase.Languages.iD
|| In a 'do' expression:
|| (\ r -> ((putStrLn . show) r)
|| ! StoreDatabase.Languages.iD) (GHC.List.head t)
|| In the definition of `main':
|| main = do
|| t <- connect $ (\ db -> query db myquery)
|| (\ r -> ((putStrLn . show) r)
|| ! StoreDatabase.Languages.iD) (GHC.List.head t)
|| mapM_ (putStrLn . show) t
Does this mean I've forgotton to import a module?
i've tried adding all exposed modules (ghc-pkg describe haskelldb)
Same result.
Do you have again some hints?
Marc
|