-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | PostgreSQL Schema Migrations
--
-- A PostgreSQL-simple schema migration utility
@package postgresql-simple-migration
@version 0.1.2.0
-- | A collection of utilites for database migrations.
module Database.PostgreSQL.Simple.Util
-- | Checks if the table with the given name exists in the database.
existsTable :: Connection -> String -> IO Bool
-- | A migration library for postgresql-simple.
--
-- For usage, see Readme.markdown.
module Database.PostgreSQL.Simple.Migration
-- | Executes migrations inside the provided MigrationContext.
--
-- Returns MigrationSuccess if the provided
-- MigrationCommand executes without error. If an error occurs,
-- execution is stopped and a MigrationError is returned.
--
-- It is recommended to wrap runMigration inside a database
-- transaction.
runMigration :: MigrationContext -> IO (MigrationResult String)
-- | The MigrationContext provides an execution context for
-- migrations.
data MigrationContext
MigrationContext :: MigrationCommand -> Bool -> Connection -> MigrationContext
-- | The action that will be performed by runMigration
migrationContextCommand :: MigrationContext -> MigrationCommand
-- | Verbosity of the library.
migrationContextVerbose :: MigrationContext -> Bool
-- | The PostgreSQL connection to use for migrations.
migrationContextConnection :: MigrationContext -> Connection
-- | MigrationCommand determines the action of the
-- runMigration script.
data MigrationCommand
-- | Initializes the database with a helper table containing meta
-- information.
MigrationInitialization :: MigrationCommand
-- | Executes migrations based on SQL scripts in the provided
-- FilePath in alphabetical order.
MigrationDirectory :: FilePath -> MigrationCommand
-- | Executes a migration based on script located at the provided
-- FilePath.
MigrationFile :: ScriptName -> FilePath -> MigrationCommand
-- | Executes a migration based on the provided bytestring.
MigrationScript :: ScriptName -> ByteString -> MigrationCommand
-- | Validates the provided MigrationCommand.
MigrationValidation :: MigrationCommand -> MigrationCommand
-- | A sum-type denoting the result of a migration.
data MigrationResult a
-- | There was an error in script migration.
MigrationError :: a -> MigrationResult a
-- | All scripts have been executed successfully.
MigrationSuccess :: MigrationResult a
-- | The name of a script. Typically the filename or a custom name when
-- using Haskell migrations.
type ScriptName = String
-- | The checksum type of a migration script.
type Checksum = ByteString
-- | Produces a list of all executed SchemaMigrations.
getMigrations :: Connection -> IO [SchemaMigration]
-- | A product type representing a single, executed SchemaMigration.
data SchemaMigration
SchemaMigration :: ByteString -> Checksum -> LocalTime -> SchemaMigration
-- | The name of the executed migration.
schemaMigrationName :: SchemaMigration -> ByteString
-- | The calculated MD5 checksum of the executed script.
schemaMigrationChecksum :: SchemaMigration -> Checksum
-- | A timestamp without timezone of the date of execution of the script.
schemaMigrationExecutedAt :: SchemaMigration -> LocalTime
instance Show MigrationCommand
instance Eq MigrationCommand
instance Read MigrationCommand
instance Ord MigrationCommand
instance Show CheckScriptResult
instance Eq CheckScriptResult
instance Read CheckScriptResult
instance Ord CheckScriptResult
instance Show a => Show (MigrationResult a)
instance Eq a => Eq (MigrationResult a)
instance Read a => Read (MigrationResult a)
instance Ord a => Ord (MigrationResult a)
instance Show SchemaMigration
instance Eq SchemaMigration
instance Read SchemaMigration
instance ToRow SchemaMigration
instance FromRow SchemaMigration
instance Ord SchemaMigration