Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."
Today's Topics:
1. Cabal hell with haskelldb-th and haskelldb-hdbc-postgresql
(Adrian May)
2. Re: Up-to-date HaskellDB sample or tute (Mats Rauhala)
3. Re: Up-to-date HaskellDB sample or tute (Adrian May)
----------------------------------------------------------------------
Message: 1
Date: Wed, 10 Jul 2013 18:10:52 +0800
From: Adrian May <[email protected]>
Subject: [Haskell-beginners] Cabal hell with haskelldb-th and
haskelldb-hdbc-postgresql
To: "[email protected]" <[email protected]>
Message-ID:
<cad-ubzgwhgst4u7ckokawpn51kagrihz-xzj0occkdimjyp...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Hi All,
Help! Why is this happening...
? cabal install haskelldb-hdbc-postgresql
Resolving dependencies...
In order, the following would be installed:
convertible-1.0.11.1 (new package)
HDBC-2.3.1.2 (new package)
HDBC-postgresql-2.3.2.1 (new package)
haskelldb-2.2.2 (reinstall) changes: mtl-2.0.1.0 -> 2.1.1
haskelldb-hdbc-2.2.2 (new package)
haskelldb-hdbc-postgresql-2.1.2 (new package)
*cabal: The following packages are likely to be broken by the reinstalls:
haskelldb-th-2.1.0
*Use --force-reinstalls if you want to install anyway.
cabal install --force-reinstalls haskelldb-hdbc-postgresql
...
Installed haskelldb-hdbc-postgresql-2.1.2
? cabal install haskelldb-th
Resolving dependencies...
In order, the following would be installed:
haskelldb-2.2.2 (reinstall) changes: mtl-2.1.1 -> 2.0.1.0
haskelldb-th-2.1.0 (reinstall) changes: haskelldb-2.2.2 added
*cabal: The following packages are likely to be broken by the reinstalls:
haskelldb-hdbc-postgresql-2.1.2
haskelldb-hdbc-2.2.2
*Use --force-reinstalls if you want to install anyway.
Adrian.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20130710/f2cfc6d7/attachment-0001.htm>
------------------------------
Message: 2
Date: Wed, 10 Jul 2013 14:25:40 +0300
From: Mats Rauhala <[email protected]>
Subject: Re: [Haskell-beginners] Up-to-date HaskellDB sample or tute
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii
How about these?
http://users.utu.fi/machra/posts/2012-08-23-relalgebra.html
http://users.utu.fi/machra/posts/2011-07-15-haskelldb.html
these shouldn't be that bitrotted. There has been some updates to
haskelldb, but nothing too big. Oh and btw, sorry for the horrible
layout
On Wed, Jul 10, 2013 at 05:57:41PM +0800, Adrian May wrote:
> Hi All,
>
> All the tutorials and samples I can find for HaskellDB seem to be
> bitrotten. Does anybody know of a newish one? I just want to connect to a
> postgres DB and run some simple queries.
>
> Or is HaskellDB superseded now?
>
> TIA,
> Adrian.
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
--
Mats Rauhala
MasseR
------------------------------
Message: 3
Date: Wed, 10 Jul 2013 19:36:29 +0800
From: Adrian May <[email protected]>
Subject: Re: [Haskell-beginners] Up-to-date HaskellDB sample or tute
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Message-ID:
<CAD-UbzGjpQZe3WB=y5kvs2mxyz0kmskbi3ugvo+yktjtrb-...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Thanks! At first sight they look compatible with what I've been finding
out. But I suspect that haskelldb-th with it's CodeGen module is history. I
just got that bit working like this:
{-# LANGUAGE TemplateHaskell #-}
import Database.HaskellDB
import Database.HaskellDB.DBSpec
import Database.HaskellDB.DBSpec.PPHelpers
import Database.HaskellDB.HDBC
import Database.HaskellDB.HDBC.PostgreSQL
import Database.HaskellDB.DBSpec.DBSpecToDBDirect
-- These work after the dbInfoToModuleFiles run ...
--import Adsdb
--import Adsdb.Test
adsDB :: (Database -> IO a) -> IO a
adsDB = postgresqlConnect adsdb_opts
adsdb_opts = [("host","localhost")
,("user","ad")
,("password","1wd1wd")
,("dbname","adsdb")]
dbinfo :: DBInfo
dbinfo = makeDBSpec "Adsdb"
(DBOptions { useBString = False , makeIdent =
mkIdentPreserving })
[ makeTInfo "Test"
[ makeCInfo "teststring" (StringT, False)
, makeCInfo "testint" (IntT, False)
]
]
main = dbInfoToModuleFiles "." "Adsdb" dbinfo
but when I import the generated code it warns like this:
Adsdb.hs:12:24:
Warning: Fields of `DBOptions' not initialised: makeIdent
In the `opts' field of a record
In the expression:
DBInfo
{dbname = "Adsdb", opts = DBOptions {useBString = False},
tbls = [TInfo
{tname = "Test",
cols = [CInfo {cname = "teststring", descr = ...},
....]}]}
In an equation for `adsdb':
adsdb
= DBInfo
{dbname = "Adsdb", opts = DBOptions {useBString = False},
tbls = [TInfo {tname = "Test", cols = [...]}]}
Adrian.
On 10 July 2013 19:25, Mats Rauhala <[email protected]> wrote:
> How about these?
>
> http://users.utu.fi/machra/posts/2012-08-23-relalgebra.html
> http://users.utu.fi/machra/posts/2011-07-15-haskelldb.html
>
> these shouldn't be that bitrotted. There has been some updates to
> haskelldb, but nothing too big. Oh and btw, sorry for the horrible
> layout
>
> On Wed, Jul 10, 2013 at 05:57:41PM +0800, Adrian May wrote:
> > Hi All,
> >
> > All the tutorials and samples I can find for HaskellDB seem to be
> > bitrotten. Does anybody know of a newish one? I just want to connect to a
> > postgres DB and run some simple queries.
> >
> > Or is HaskellDB superseded now?
> >
> > TIA,
> > Adrian.
>
> > _______________________________________________
> > Beginners mailing list
> > [email protected]
> > http://www.haskell.org/mailman/listinfo/beginners
>
>
> --
> Mats Rauhala
> MasseR
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20130710/3774a566/attachment-0001.htm>
------------------------------
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
End of Beginners Digest, Vol 61, Issue 14
*****************************************