RE: [Haskell-cafe] Trivial database access in Haskell

2006-12-12 Thread Simon Peyton-Jones
Paul

The people you want are probably

HDBCJohn Goerzen [EMAIL PROTECTED]

HaskellDB   Anders Höckersten [EMAIL PROTECTED] and
Bjorn Bringert [EMAIL PROTECTED]

HSQLKrasimir Angelov [EMAIL PROTECTED]

Takusen Bayley, Alistair [EMAIL PROTECTED]

(did I miss any?)

They probably haven't been online since your msg, but I'm sure they'll be keen 
to help you use the fruit of their labours -- and would welcome your help in 
documenting them better.  You might also find help on the #haskell IRC channel.

Simon

| OK, thanks for the gentle push. After a bit of digging, I decided that
| the takusen link looked like a darcs repository, and I downloaded
| darcs and got takusen. I installed GHC 6.6 in a spare VM (no PC round
| I can install stuff on just now, I'll do this properly later). On the
| assumption that the takusen.cabal file means I should look at Cabal, I
| had a dig and found the incantation runhaskell setup.hs.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Trivial database access in Haskell

2006-12-12 Thread Bjorn Bringert

Hi Paul,

as Simon notes, I maintain HaskellDB. I think that HaskellDB isn't  
exactly what you are looking for at the moment. You seem to want to  
run SQL queries, and HaskellDB is designed to free you from writing SQL.


I'm not sure if anyone has mentioned it yet, but HSQL 1.7 includes  
Oracle support (though I haven't tested it). You can get it from  
http://sourceforge.net/project/showfiles.php? 
group_id=65248package_id=93958


Here's what I would do in your situation:

1. Join the #haskell IRC channel on irc.freenode.net.
2. Try to install your chosen library.
3. Ask questions in the IRC channel when you run into problems.  
Chances are that you will have some library and Cabal developers  
there to help you.


/Björn

On 12 dec 2006, at 10.11, Simon Peyton-Jones wrote:


Paul

The people you want are probably

HDBCJohn Goerzen [EMAIL PROTECTED]

HaskellDB   Anders Höckersten [EMAIL PROTECTED] and
Bjorn Bringert [EMAIL PROTECTED]

HSQLKrasimir Angelov [EMAIL PROTECTED]

Takusen Bayley, Alistair [EMAIL PROTECTED]

(did I miss any?)

They probably haven't been online since your msg, but I'm sure  
they'll be keen to help you use the fruit of their labours -- and  
would welcome your help in documenting them better.  You might also  
find help on the #haskell IRC channel.


Simon

| OK, thanks for the gentle push. After a bit of digging, I decided  
that

| the takusen link looked like a darcs repository, and I downloaded
| darcs and got takusen. I installed GHC 6.6 in a spare VM (no PC  
round
| I can install stuff on just now, I'll do this properly later). On  
the
| assumption that the takusen.cabal file means I should look at  
Cabal, I

| had a dig and found the incantation runhaskell setup.hs.


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Trivial database access in Haskell

2006-12-12 Thread Seth Gordon
Taral wrote:
 On 12/11/06, Paul Moore [EMAIL PROTECTED] wrote:
 
 F:\cabal-1.1.6.1runhaskell Setup.lhs install
 Installing: C:\Program Files\Haskell\Cabal-1.1.6.1\ghc-6.6 
 C:\Program Files\Haskell\bin Cabal-1.1.6.1...
 Setup.lhs: Error: Could not find module: Distribution.Compiler with
 any suffix:
 [hi]
 
 
 The magic commands are:
 
 runhaskell Setup.lhs configure

Also, if you're going to profile the code that uses this module, you
need to compile the libraries with profiling enabled; you can do this by
 doing configure -p instead of configure above.

 runhaskell Setup.lhs build
 runhaskell Setup.lhs install
 

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Trivial database access in Haskell

2006-12-11 Thread Kirsten Chevalier

On 12/11/06, Paul Moore [EMAIL PROTECTED] wrote:

I've looked at the various database access libraries for Haskell, but
they all seem to be missing a couple of key pieces if I want to use
them:

1. Simple documentation of how to install the library (starting from a
vanilla GHC installation on Windows, plus Oracle software, to the
point where I can use the library in my code). All I need is Oracle
access, so other database client libraries can be ignored. I'd rather
not use ODBC, but will if required.

2. Simple examples on how to actually run a query. For example, how do
I code the follwing SQL*Plus code (should be pretty self-explanatory)
in Haskell:

connect scott/[EMAIL PROTECTED]
select * from emp;

(Connect to the database mydb as user scott, password tiger, and
issue the query select * from emp). Ideally, I'd like the Haskell
code to not be *too* much more verbose than this (although I can
accept that Haskell, beng a general language, won't be able to be
quite as concise as a special tool can manage).

Without this basis, I don't really have a way to evaluate the various
libraries available...



This is when you write that documentation :-) And I say that without
knowing anything about any of the Haskell database libraries -- I just
suspect that if you can't find any good documentation for them, that's
your cue to write it.

This might not seem like a helpful answer, but often it's the best
answer anyone can give. I realize that you only have so many hours in
the day, but only a few people get paid to work on Haskell full-time.
So if you really wanted to find out whether the existing libraries
would work for your purposes, try it, and write up what you found so
that other people can benefit from it.

Cheers,
Kirsten

--
Kirsten Chevalier* [EMAIL PROTECTED] *Often in error, never in doubt
We used to say that our love was like hemp rope / Three times as strong as the
rope that you buy domestically. -- Dar Williams
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Trivial database access in Haskell

2006-12-11 Thread Paul Moore

On 12/11/06, Kirsten Chevalier [EMAIL PROTECTED] wrote:

This is when you write that documentation :-) And I say that without
knowing anything about any of the Haskell database libraries -- I just
suspect that if you can't find any good documentation for them, that's
your cue to write it.


Sorry, I didn't make that clear - I absolutely would be happy to write
up whatever I ended up with that works.

The point I was trying (badly!) to make was that without sample code
on how to do trivial queries, I can't work out which library is
closest to what I want. And without installation instructions, I can't
try them out.

What I *can* do, is to attempt to install one of the libraries that
looks closest to what I want (probably HDBC, because I'm familiar with
the Python DB-API). But I honestly have little or no idea how to start
- following the HDBC link on the Haskell Wiki leads to a huge list of
tar.gz files, with no indication of which one I might want :-(

Option 2, Takusen, leads to a file listing, but no downloadable package.

Option 3, HSQL, leads to a page which doesn't mention Oracle support
(even though the Wiki page does) so I'm put off trying further...


This might not seem like a helpful answer, but often it's the best
answer anyone can give. I realize that you only have so many hours in
the day, but only a few people get paid to work on Haskell full-time.
So if you really wanted to find out whether the existing libraries
would work for your purposes, try it, and write up what you found so
that other people can benefit from it.


Will do, but I need help with try it, and I'm guessing as to which
library is my best bet :-(

This is my first real experience with trying to obtain and use a 3rd
party library with Haskell, so I apologise if these are newbie-level
dumb issues. I'm not trying to complain, but I do suspect there is an
issue here with easy library availability that the Haskell community
could look at. Python was in a similar situation for a long time, and
I suspect it's just a bit further down the track. Certainly from what
I've seen of Cabal, it's similar in philosophy to Python's distutils.
But this is going off on a tangent - maybe I'll revisit it when I've
got some more experience under my belt with installing DB libraries
:-)

Paul.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Trivial database access in Haskell

2006-12-11 Thread Kirsten Chevalier

On 12/11/06, Paul Moore [EMAIL PROTECTED] wrote:

The point I was trying (badly!) to make was that without sample code
on how to do trivial queries, I can't work out which library is
closest to what I want. And without installation instructions, I can't
try them out.



Well, if anyone has that sample code, someone who is reading this
mailing list probably does. But if you can't find even simple sample
code, that's probably a sign that not a lot of people have tried to
write large database applications in Haskell using the existing
libraries, or at all. I may be wrong, but I suspect that that's true.
Somebody has to be first.

So this is your cue to RTFS. And I'm trying to say RTFS in the
nicest possible way in which I can say it. With an F that stands for
friendly although I suspect that the code is going to look to you
like anything but.


This is my first real experience with trying to obtain and use a 3rd
party library with Haskell, so I apologise if these are newbie-level
dumb issues. I'm not trying to complain, but I do suspect there is an
issue here with easy library availability that the Haskell community
could look at. Python was in a similar situation for a long time, and
I suspect it's just a bit further down the track. Certainly from what
I've seen of Cabal, it's similar in philosophy to Python's distutils.
But this is going off on a tangent - maybe I'll revisit it when I've
got some more experience under my belt with installing DB libraries
:-)


Don't apologize; you're not being dumb. But, you have to realize that
if you're using Haskell at all, you *are* the Haskell community.

Cheers,
Kirsten

--
Kirsten Chevalier* [EMAIL PROTECTED] *Often in error, never in doubt
...I thought the secret of life was obvious: be here now, love as if your whole
life depended on it, find your life's work, and try to get hold of a giant
panda. -- Anne Lamott
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Trivial database access in Haskell

2006-12-11 Thread Paul Moore

On 12/11/06, Kirsten Chevalier [EMAIL PROTECTED] wrote:

Don't apologize; you're not being dumb. But, you have to realize that
if you're using Haskell at all, you *are* the Haskell community.


OK, thanks for the gentle push. After a bit of digging, I decided that
the takusen link looked like a darcs repository, and I downloaded
darcs and got takusen. I installed GHC 6.6 in a spare VM (no PC round
I can install stuff on just now, I'll do this properly later). On the
assumption that the takusen.cabal file means I should look at Cabal, I
had a dig and found the incantation runhaskell setup.hs.

I got the error:

F:\takusenrunhaskell setup.hs

setup.hs:11:7:
   Could not find module `Distribution.Compat.FilePath':
 it is hidden (in package Cabal-1.1.6)

I assume this relates to the note in setup.hs For ghc-6.6 you will
need to first install Cabal-1.1.6.1, but as I got GHC from a Windows
binary install, I'm not sure where to go from here. I found the Cabal
webpage and downloaded 1.1.6.1. Trying to install it, I got the
following:

F:\cabal-1.1.6.1runhaskell Setup.lhs install
Setup.lhs: error reading ./.setup-config; run setup configure command?


F:\cabal-1.1.6.1runhaskell Setup.lhs configure
Configuring Cabal-1.1.6.1...
configure: Dependency base-any: using base-2.0
configure: Using install prefix: C:\Program Files
configure: Binaries installed in: C:\Program Files\Haskell\bin
configure: Libraries installed in: C:\Program
Files\Haskell\Cabal-1.1.6.1\ghc-6.6
configure: Private binaries installed in: C:\Program Files\Cabal-1.1.6.1
configure: Data files installed in: C:\Program Files\Common Files\Cabal-1.1.6.1
configure: Using compiler: c:\ghc\ghc-6.6\bin\ghc.exe
configure: Compiler flavor: GHC
configure: Compiler version: 6.6
configure: Using package tool: c:\ghc\ghc-6.6\bin\ghc-pkg.exe
configure: Using ar found on system at: c:\ghc\ghc-6.6\bin\ar.exe
configure: No haddock found
configure: No pfesetup found
configure: No ranlib found
configure: Using runghc found on system at: c:\ghc\ghc-6.6\bin\runghc.exe
configure: No runhugs found
configure: No happy found
configure: No alex found
configure: Using hsc2hs: c:\ghc\ghc-6.6\bin\hsc2hs.exe
configure: No c2hs found
configure: No cpphs found
configure: No greencard found

F:\cabal-1.1.6.1runhaskell Setup.lhs install
Installing: C:\Program Files\Haskell\Cabal-1.1.6.1\ghc-6.6 
C:\Program Files\Haskell\bin Cabal-1.1.6.1...
Setup.lhs: Error: Could not find module: Distribution.Compiler with any suffix:
[hi]

OK, that's as far as I can go. Remember, what I *want* to do is to run
some SQL against my database to get some data into a Haskell program.
I'm not up to debugging a Cabal install. (At this point, if I was
doing this for real work, I'd be off to the Python website like a
shot...)

Can anyone help? I promise, I will document what I end up with!

Paul.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Trivial database access in Haskell

2006-12-11 Thread Kirsten Chevalier

Now you're getting somewhere! (Even though it may not seem like it.)
At this point, this is probably a better place to ask:
http://www.haskell.org/cabal/
In particular, it says where to ask questions. I haven't used Cabal
much myself and I suspect that the people who know about Cabal are
more likely to notice your question if you ask somewhere other than on
this list, which is noisy.

Good luck.

Cheers,
Kirsten

--
Kirsten Chevalier* [EMAIL PROTECTED] *Often in error, never in doubt
I'm sick of my genitalia being used as an insult. Are you? -- Bitch and
Animal
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Trivial database access in Haskell

2006-12-11 Thread Taral

On 12/11/06, Paul Moore [EMAIL PROTECTED] wrote:

F:\cabal-1.1.6.1runhaskell Setup.lhs install
Installing: C:\Program Files\Haskell\Cabal-1.1.6.1\ghc-6.6 
C:\Program Files\Haskell\bin Cabal-1.1.6.1...
Setup.lhs: Error: Could not find module: Distribution.Compiler with any suffix:
[hi]


The magic commands are:

runhaskell Setup.lhs configure
runhaskell Setup.lhs build
runhaskell Setup.lhs install

--
Taral [EMAIL PROTECTED]
You can't prove anything.
   -- Gödel's Incompetence Theorem
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Trivial database access in Haskell

2006-12-11 Thread Alec Berryman
Paul Moore on 2006-12-11 22:46:44 +:

 What I *can* do, is to attempt to install one of the libraries that
 looks closest to what I want (probably HDBC, because I'm familiar with
 the Python DB-API). But I honestly have little or no idea how to start
 - following the HDBC link on the Haskell Wiki leads to a huge list of
 tar.gz files, with no indication of which one I might want :-(

 Option 2, Takusen, leads to a file listing, but no downloadable package.
 
 Option 3, HSQL, leads to a page which doesn't mention Oracle support
 (even though the Wiki page does) so I'm put off trying further...

I believe HSQL provides a similar interface to the the Python DB-API,
but you're right, I don't believe anyone has written Oracle support.



signature.asc
Description: Digital signature
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Trivial database access in Haskell

2006-12-11 Thread Stefan O'Rear
On Mon, Dec 11, 2006 at 11:25:59PM +, Paul Moore wrote:
 On 12/11/06, Kirsten Chevalier [EMAIL PROTECTED] wrote:
 Don't apologize; you're not being dumb. But, you have to realize that
 if you're using Haskell at all, you *are* the Haskell community.
 
 OK, thanks for the gentle push. After a bit of digging, I decided that
 the takusen link looked like a darcs repository, and I downloaded
 darcs and got takusen. I installed GHC 6.6 in a spare VM (no PC round
 I can install stuff on just now, I'll do this properly later). On the
 assumption that the takusen.cabal file means I should look at Cabal, I
 had a dig and found the incantation runhaskell setup.hs.
 
 I got the error:
 
 F:\takusenrunhaskell setup.hs
 
 setup.hs:11:7:
Could not find module `Distribution.Compat.FilePath':
  it is hidden (in package Cabal-1.1.6)

'hidden' means that it is installed, but access is forbidden (no,
I don't know why the feature exists).  To allow access:

ghc-pkg expose Cabal 

(disclaimer: untested command)
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Trivial database access in Haskell

2006-12-11 Thread jeff p

Hello,


1. Simple documentation of how to install the library (starting from a
vanilla GHC installation on Windows, plus Oracle software, to the
point where I can use the library in my code). All I need is Oracle
access, so other database client libraries can be ignored. I'd rather
not use ODBC, but will if required.


I use HDBC to connect (via the ODBC driver) to a MS SQL Server and a
Sybase server (ASE). I'm running on a windows machine inside of
cygwin. I had no trouble installing HDBC following the instructions in
the distribution with GHC 6.6; by distribution I mean the  files
hdbc_1.0.1.2.tar.gz (general HDBC library) and
hdbc-odbc_1.0.1.1.tar.gz (specific ODBC driver) from the HDBC gopher
page (http://gopher.quux.org:70/devel/hdbc).


2. Simple examples on how to actually run a query. For example, how do
I code the follwing SQL*Plus code (should be pretty self-explanatory)
in Haskell:

connect scott/[EMAIL PROTECTED]
select * from emp;


Here is a GHCi session:

   Prelude :m Database.HDBC Database.HDBC.ODBC
   Prelude Database.HDBC.ODBC Database.HDBCdo c - connectODBC
conStr; handleSqlError $ quickQuery c select * from emp []

where conStr is an appropriate ODBC connection string (e.g. DSN =
mydb if you have the DSN defined, or you can find the Oracle string
at http://www.connectionstrings.com/). This should cause a list of
lists of SqlValues to be printed which represent the rows in your
result set.

Here is the documentation for HDBC:

   http://darcs.complete.org/hdbc/doc/Database-HDBC.html

Although it is mostly type signatures, there is some explanation.
There are also a few useful haskell-cafe discussions on aspects of
using HDBC.

hope this helps,
 Jeff
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe