refurb- Tools for maintaining a database

Safe HaskellNone



Top level module of Refurb along which re-exports the library portion of Refurb (Types and MigrationUtils)



refurbMain :: (FilePath -> IO ConnInfo) -> [Migration] -> IO () Source #

Main entry point for refurbishing.

In refurb readDatabaseConnectionString migrations, readDatabaseConnectionString is a function taking the configuration file path from the command line and yielding a pair of actual and loggable connection strings, and migrations is a list of Migration records to consider.

For example:

  module Main where

  import Refurb (Migration, MonadMigration, execute_, schemaMigration, refurbMain)

  migrations :: [Migration]
  migrations =
    [ schemaMigration "create-my-table" createMyTable

  createMyTable :: MonadMigration m => m ()
  createMyTable =
    void $ execute_ "create table my_table (...)"

  main :: IO ()
  main = refurbMain readDatabaseConnInfo migrations