A framework of packages for building Haskell applications
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
Peter J. Jones a2ad04ab70
Rename Opaleye -> Database, add helper function
1ヶ月前
..
example Rename Opaleye -> Database, add helper function 1ヶ月前
src/Iolaus Rename Opaleye -> Database, add helper function 1ヶ月前
test Rename Opaleye -> Database, add helper function 1ヶ月前
.envrc Update build files to match latest release of nix-hs 2ヶ月前
CHANGELOG.md Add Iolaus.Opaleye.Config 6ヶ月前
LICENSE Build with nix, fix duplicate LICENSE file to make nix/cabal happy 6ヶ月前
README.md Rename Opaleye -> Database, add helper function 1ヶ月前
Setup.hs Add Iolaus.Opaleye.Config 6ヶ月前
default.nix Update build files to match latest release of nix-hs 2ヶ月前
iolaus-opaleye.cabal Rename Opaleye -> Database, add helper function 1ヶ月前
shell.nix Update build files to match latest release of nix-hs 2ヶ月前

README.md

Iolaus.Database

The goal of this library is to provide a simple wrapper around the opaleye and postgresql-simple packages without leaking a MonadIO interface into your application’s monad, all while exposing an mtl + lens style of composing the major components of an application.

Using this library is fairly straight forward:

  1. Create your monad transformer stack and then make it an instance of AsDBError and HasDatabase.

  2. Parse a Config value from a configuration file.

  3. Call initDatabase to create the MonadReader value you`ll need.

  4. Use the query functions inside your transformer stack!

For more details, including a tutorial, please see the example.hs file that is part of this distribution.

Running the Example

To run the example application you first need to set two environment variables:

  • DB_CONN: The PostgreSQL database connection string. Create a database with any name you like, then set this variable.

  • iolaus_opaleye_datadir: The path to the directory containing this README.md file. This is so the example application can find the schema migration files.

Examples of these environment variables can be found in the top-level .envrc file.