Questions tagged [hdbc]

HDBC, Haskell Database Connectivity, is a Haskell library for connecting to and querying relational database management systems. The library provides a uniform interface to several common RDBMSs through the use of pluggable back ends.

59 questions
3
votes
1 answer

Haskell HDBC-Sqlite3 always returns SqlByteString values

I am using HDBC sqlite3 haskell driver to access local sqlite3 database which PRAGMA encoding is UTF-8 And as result, for example for SELECT id, title FROM some_table I'm always getting the result like this: [[SqlByteString "1", SqlByteString…
pechenie
  • 1,908
  • 2
  • 18
  • 17
3
votes
1 answer

How to connect to Oracle DB in Haskell

Can anyone share some tips on how to connect to Oracle DB using Haskell? I found it quite difficult. What I've done so far: (1) Checked out Persistent's documentation, on this page http://www.yesodweb.com/book/persistent it mentions all the…
Shawn Lu
  • 1,556
  • 11
  • 11
3
votes
0 answers

Getting an convertible exception while using Database.ODBC.describeTable

First of all, I'm a Haskell novice who took the big leap of using Haskell now on a first real "Haskell project". In short it's about gathering schema information from different data sources. I decided to use HDBC with ODBC but I'm getting this…
Chirs
  • 567
  • 2
  • 15
3
votes
1 answer

Deserializing data form a SQL Database

I've a little application, backed by a database (SQLite, but it's not really relevant to the question). I've defined some types like: data Whatever = Whatever Int Int String String data ImportantStuff = ImportantStuff { id :: Int, count :: Int, name…
Tomo
  • 3,431
  • 5
  • 25
  • 28
3
votes
1 answer

How to effectively check if an entry is present using HDBC in haskell?

Like mentionned in my question, I have an unique constraint on a table in which I want to insert some data. I have to check if the data is already present and insert it if not. That is what I can't seem to be able to do. Here is my code: import…
Yain Tao
  • 71
  • 2
  • 6
3
votes
1 answer

How do you fill in the parameters for an SQL IN placeholder with HDBC?

I'm trying to do something like this with Database.HDBC.PostgreSQL: run c "update questions set deleted = now() where question_id in (?)" [toSql ids] where ids is [Int]. But I get the error No instance for (Data.Convertible.Base.Convertible [Int]…
dan
  • 43,914
  • 47
  • 153
  • 254
3
votes
1 answer

Haskell HDBC Elegance in F#?

I'm struck by Haskell's terseness and elegance. But I work in a .Net house, so I use F# when I can get away with it--I may be the only one of hundreds across the country who uses it. Does ADO.NET or F# offer something as terse and elegant as HDBC's…
Jeff Maner
  • 1,179
  • 9
  • 23
3
votes
1 answer

HDBC-ODBC SQL Server need commit after quickQuery

I'm giving my first steps into HDBC using ODBC to connect to a local SQL Server. After a quickQuery on the connection, I can't close it. I need to perform a commit first. Is this the way it is supposed to be? Why is the commit necessary when I'm…
Thiago Negri
  • 5,221
  • 2
  • 28
  • 39
3
votes
2 answers

Haskell, HDBC, ODBC, MySQL and Mac OS X

I'm trying to use Haskell (version 6.10.3) and HDBC to connect to a MySQL Database. I've chosen to do it with Haskell ODBC. I've used cabal to install HDBC (2.1.1) and HDBC-ODBC (2.1.0.0). I've downloaded and installed the MySQL ODBC driver (5.1.5).…
Jamie McCrindle
  • 9,114
  • 6
  • 43
  • 48
2
votes
2 answers

cannot load HDBC-postgresql

I am on windows XP. I have installed Yesod by following the steps on this page: http://www.yesodweb.com/page/five-minutes I have created a scaffolded application with Postgresql persistence. When I ran "yesod devel" for the first time it gave me an…
akonsu
  • 28,824
  • 33
  • 119
  • 194
2
votes
1 answer

Haskell Unicode column name in ODBC

I am trying to query some data from a MSSQL database through HDBC and ODBC. I have however run into a problem when trying to query data from a table with unicode in the column names. Consider the following MWE: mwe :: IConnection conn => conn -> IO…
simwir
  • 23
  • 5
2
votes
1 answer

cannot add Database.HDBC.Sqlite3 to stack file

I am trying to implement the database using both libs HDBC and HDBC-sqlite3, while I am getting error for adding HDBC-Sqlie3 and I have tried the below : HDBC-Sqlite3 HDBC-Sqlite3 -any HDBC-Sqlite3 >= 2.3.3.0 && < 2.3.3.1 HDBC-Sqlite3 >= 2.3.3.0…
khaled alomar
  • 673
  • 4
  • 25
2
votes
1 answer

How to efficiently work with the nested monads I get from SQLite3 and HDBC

I have to admit that I am still not "there" yet when it comes to working efficiently with monads, so please forgive me if this is an easy question. I also have to apologize for not supplying working code, as this questions more related to a concept…
Fredrik Karlsson
  • 485
  • 8
  • 21
2
votes
1 answer

does Database.HDBC support named parameters?

I don't like relying on positional parameters, is it possible to do so with HDBC? I could see passing [(String, SqlValue)] instead of [SqlValue] as arguments to the various executing functions of this package. In a nutshell, I'd rather select …
smoothdeveloper
  • 1,972
  • 18
  • 19
2
votes
1 answer

HDBC Driver for FireBird Database

Can someone point me to an HDBC(Haskell) Driver for FireBird Database, Nothing turned up on Google. Is my best option at this point to use an HDBC-ODBC bridge to connect to a FireBird database from a Haskell Program?
BM.
  • 1,661
  • 2
  • 14
  • 20