Popularity
8.7
Stable
Activity
0.0
Stable
5
28
3

Monthly Downloads: 2
Programming language: Haskell
License: MIT License
Tags: Database     Unclassified    
Latest version: v0.1.0

heroku-persistent alternatives and similar packages

Based on the "Unclassified" category.
Alternatively, view persistent-database-url alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of heroku-persistent or a related project?

Add another 'Unclassified' Package

README

persistent-database-url

Converts the parameters parsed from a database url to the concrete configuration types required by persistent.

Currently, only persistent-postgresql's PostgresConf is provided.

Installation

cabal install persistent-database-url

Example Usage

Adjusting the Yesod scaffold to run on Heroku:

config/settings.yml

database-url: "_env:DATABASE_URL:postgres://user:pass@localhost:5432/dbname"
database-pool-size: "_env:DB_POOL:5"

Settings.hs:

import Database.Persist.URL (fromDatabaseUrl)

instance FromJSON AppSettings where
    parseJSON = withObject "AppSettings" $ \o -> do
        appDatabaseConf <- fromDatabaseUrl
                             <$> o .: "database-pool-size"
                             <*> o .: "database-url"
        -- ...

        return AppSettings {..}

How to run tests

stack test