beam-automigrate-0.1.0.0: DB migration library for beam, targeting Postgres.

Safe HaskellNone
LanguageHaskell2010

Database.Beam.AutoMigrate.Diff

Contents

Synopsis

Documentation

class Diffable a where Source #

Methods

diff :: a -> a -> Diff Source #

Instances
Diffable Tables Source # 
Instance details

Defined in Database.Beam.AutoMigrate.Diff

Methods

diff :: Tables -> Tables -> Diff Source #

Diffable Sequences Source # 
Instance details

Defined in Database.Beam.AutoMigrate.Diff

Diffable Enumerations Source # 
Instance details

Defined in Database.Beam.AutoMigrate.Diff

Diffable Schema Source #

Computes the diff between two Schemas, either failing with a DiffError or returning the list of Edits necessary to turn the first into the second.

Instance details

Defined in Database.Beam.AutoMigrate.Diff

Methods

diff :: Schema -> Schema -> Diff Source #

type Diff = DiffA [] Source #

newtype Priority Source #

Some notion of Priority. The lower the value, the higher the priority.

Constructors

Priority Word8 

Reference implementation, for model-testing purposes

diffTablesReferenceImplementation :: Tables -> Tables -> Diff Source #

A slow but hopefully correct implementation of the diffing algorithm, for QuickCheck comparison with more sophisticated ones.

Hopefully-efficient implementation

sortEdits :: [WithPriority Edit] -> [WithPriority Edit] Source #

Sort edits according to their execution order, to make sure they don't reference something which hasn't been created yet.