-
Notifications
You must be signed in to change notification settings - Fork 17
Connect
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.
''To be filled out''
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"