Skip to content
m4dc4p edited this page Oct 11, 2012 · 2 revisions

HaskellDB is able to use the HDBC driver to connect to several supported database. The HSQL driver is available but unsupported.

Postgres using HDBC

''To be filled out''

Sqlite3 using HDBC

Install HDBC and HDBC-sqlite3

> cabal install HDBC HDBC-sqlite3 

Install haskelldb and haskelldb-hdbc-sqlite3

> cabal install haskelldb haskelldb-hdbc haskelldb-hdbc-sqlite3

Create connection code for the database "sqlite.db"

import Control.Monad.Trans
import Database.HaskellDB.HDBC.SQLite3
import Database.HaskellDB

withDB :: MonadIO m => (Database -> m a) -> m a
withDB = sqliteConnect "sqlite.db"
Clone this wiki locally