CopyPaste from YesodBook gives "Could not find module `Database.Persist.Sqlite`"

525 views
Skip to first unread message

Fredrik Carlén

unread,
Jul 12, 2012, 1:14:37 PM7/12/12
to yeso...@googlegroups.com
Is Database.Persist.Sqlite removed from the persistent module? I can't find it listed on http://hackage.haskell.org/package/persistent.

It seems I have the latest persistent module installed; output from `$ cabal list` is:
* persistent
    Synopsis: Type-safe, multi-backend data serialization.
    Default available version: 0.9.0.4
    Installed versions: 0.9.0.4
    Homepage: http://www.yesodweb.com/book/persistent
    License:  MIT

Yet, I get
`
    Could not find module `Database.Persist.Sqlite'
    Perhaps you meant
      Database.Persist.Store (from persistent-0.9.0.4)
      Database.Persist.Util (from persistent-0.9.0.4)
      Database.Persist.TH (from persistent-template-0.9.0.2)
`
when doing `$ ghc -ddump-splices yesodpersistentex1.hs -v` (I want to see the output generated...)

The file yesodpersistentex1.hs contains a copypaste from the Yesod Book, page 96:
<file>
{-# LANGUAGE QuasiQuotes, TypeFamilies, GeneralizedNewtypeDeriving, TemplateHaskell, OverloadedStrings, GADTs #-}
import Database.Persist
import Database.Persist.TH
import Database.Persist.Sqlite
import Control.Monad.IO.Class (liftIO)

mkPersist sqlSettings [persist|
Person
    name String
    age Int
    deriving Show
|]
main = return ()
</file>

Excuse any idiosyncrasies.


Fredrik Carlén

unread,
Jul 12, 2012, 1:19:28 PM7/12/12
to yeso...@googlegroups.com
OK, I just commented out the import of Database.Persist.Sqlite and the thing compiles. It seems the module isn''t used in this particular snippet. A vestige from the days of yore, perchance?
/F

Matthias Hörmann

unread,
Jul 12, 2012, 1:30:34 PM7/12/12
to yeso...@googlegroups.com
The individual database backends are in packages persistent-sqlite persistent-mysql, persistent-postgresql, persistent-mongoDb,...

This is done because otherwise persistent would depend on the low level packages for all of them and be much more likely to break.

Fredrik Carlén

unread,
Jul 12, 2012, 1:37:11 PM7/12/12
to yeso...@googlegroups.com
Thanks. My Hayoo search wasn't as extensive as I thought. :) On the other hand, cabal didn't report it as at all available although I have made my updates like a good boy...well, well.
/F

Matthias Hörmann

unread,
Jul 12, 2012, 6:56:02 PM7/12/12
to yeso...@googlegroups.com
You can actually use

cabal list persistent

to get a full list of all the packages with persistent in their name.

Fredrik Carlén

unread,
Jul 13, 2012, 4:30:58 AM7/13/12
to yeso...@googlegroups.com
Le 2012-07-13 00:56, Matthias H�rmann a �crit :
> You can actually use
>
> cabal list persistent
>
> to get a full list of all the packages with persistent in their name.
>
Thanks a lot, bloody useful!
/F

Kirill Zaborsky

unread,
Jul 13, 2012, 4:32:47 AM7/13/12
to yeso...@googlegroups.com
Also you could use hoogle for that, e.g. 
http://www.haskell.org/hoogle/?hoogle=persistent
or from command-line

Kind regards,
Kirill Zaborsky

2012/7/13 Fredrik Carlén <fredrik...@gmail.com>

Fredrik Carlén

unread,
Jul 13, 2012, 4:45:51 AM7/13/12
to yeso...@googlegroups.com
Yes, Kirill, that's what I did, I just didn't have the minutest bit of
insight to recognise that it wasn't in persistent, but in
persistent-sqlite...
But thanks!
/F

2012/7/13 Kirill Zaborsky <qri...@gmail.com>:
--
Fredrik Carlén
Hammarby Allé 64 5tr.
120 61 STOCKHOLM

+46 76 16 18 804 (jobbmob)
+46 73 70 77 488
Reply all
Reply to author
Forward
0 new messages