[Haskell-cafe] Re: HDBC converting a date sql value to UTCTime
Alternatively is there a way to create a UTCTime value from an epoch integer (no of seconds since epoch). I can't find a suitable constructor with Hoogle. thank you in advance, George. On Thu, Jun 19, 2008 at 10:08 PM, George Moschovitis < [EMAIL PROTECTED]> wrote: > Hello, > > I am HDBC with the Postgres driver. I am trying to read a simple date > column from the DB: > > stmt <- DB.prepare conn "SELECT date FROM my_table ORDER BY date DESC LIMIT > 1" > DB.execute stmt [] > DB.commit conn > rows <- fetchAllRows' stmt > let ((d:_):_) = rows > > the d variable is of type: > > SqlEpochTime 1213736400 > > I am wondering how to convert this value to an UTCTime value. > > Any help appreciated (I am a newbie). > > -g. > > > > -- > http://gmosx.me.gr > http://joy.gr > http://cull.gr > http://nitroproject.org > http://phidz.com > http://joyerz.com -- Walt Disney - "I love Mickey Mouse more than any woman I have ever known." ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] HDBC converting a date sql value to UTCTime
Hello, I am HDBC with the Postgres driver. I am trying to read a simple date column from the DB: stmt <- DB.prepare conn "SELECT date FROM my_table ORDER BY date DESC LIMIT 1" DB.execute stmt [] DB.commit conn rows <- fetchAllRows' stmt let ((d:_):_) = rows the d variable is of type: SqlEpochTime 1213736400 I am wondering how to convert this value to an UTCTime value. Any help appreciated (I am a newbie). -g. -- http://gmosx.me.gr http://joy.gr http://cull.gr http://nitroproject.org http://phidz.com http://joyerz.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Haskell FCGI server.
Dear devs, is it possible to create a FCGI server that listens to a specific port using the Haskell FCGI library? The front end web server would then communicate with this back end FCGI server through this port. A small example would be really appreciated. thanks, George. -- http://nitroproject.org http://phidz.com http://blog.gmosx.com http://cull.gr http://www.joy.gr http://www.me.gr ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] HDBC or HSQL
Ok, I am evaluating HDBC. I wrote a simple test program: ... Can I get a more specific error? Is there a way to inspect this exception more deeply? handleSqlError does the trick, for other newbies: main = handleSqlError $ do dbc <- connectPostgreSQL "dbname=test user=postgres password=,psql51e" putStrLn "done" Everything works ok now, I cann access my psql database and run basic sql queries/updates. -g. -- http://www.me.gr http://phidz.com http://blog.gmosx.com http://cull.gr http://www.joy.gr http://nitroproject.org ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Fwd: [Haskell-cafe] HDBC or HSQL
Ok, I am evaluating HDBC. I wrote a simple test program: import Database.HDBC import Database.HDBC.PostgreSQL main = do db <- connectPostgreSQL "dbname=Test user=postgres password='mypass'" putStrLn "done" when I run it I get the following error: db: exception :: Database.HDBC.SqlError Can I get a more specific error? Is there a way to inspect this exception more deeply? thanks, -g. -- http://www.me.gr http://phidz.com http://blog.gmosx.com http://cull.gr http://www.joy.gr http://nitroproject.org ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] HDBC or HSQL
Dear devs, I am a Haskell newbie and I would like to hear your suggestions regarding a Database conectivity library: HSQL or HDBC ? which one is better / more actively supported? thanks in advance, -g. -- http://phidz.com http://blog.gmosx.com http://cull.gr http://www.joy.gr http://nitroproject.org ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe