| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Unison.Codebase.SqliteCodebase.Migrations
Synopsis
- migrations :: MVar ConsoleRegion -> (Reference -> Transaction ConstructorType) -> TVar (Map Hash TermBufferEntry) -> TVar (Map Hash DeclBufferEntry) -> CodebasePath -> Map SchemaVersion (Connection -> IO ())
- data CodebaseVersionStatus
- checkCodebaseIsUpToDate :: Transaction CodebaseVersionStatus
- ensureCodebaseIsUpToDate :: MonadIO m => LocalOrRemote -> CodebasePath -> (Reference -> Transaction ConstructorType) -> TVar (Map Hash TermBufferEntry) -> TVar (Map Hash DeclBufferEntry) -> Bool -> BackupStrategy -> VacuumStrategy -> Connection -> m (Either OpenCodebaseError ())
- backupCodebaseIfNecessary :: BackupStrategy -> LocalOrRemote -> Connection -> SchemaVersion -> SchemaVersion -> CodebasePath -> IO ()
- runIntegrityChecks :: MVar ConsoleRegion -> Transaction ()
Documentation
Arguments
| :: MVar ConsoleRegion | |
| -> (Reference -> Transaction ConstructorType) | A |
| -> TVar (Map Hash TermBufferEntry) | |
| -> TVar (Map Hash DeclBufferEntry) | |
| -> CodebasePath | |
| -> Map SchemaVersion (Connection -> IO ()) |
Mapping from schema version to the migration required to get there. E.g. The migration at index 2 must be run on a codebase at version 1.
data CodebaseVersionStatus Source #
Constructors
| CodebaseUpToDate | |
| CodebaseUnknownSchemaVersion SchemaVersion | |
| CodebaseRequiresMigration SchemaVersion SchemaVersion |
Instances
ensureCodebaseIsUpToDate Source #
Arguments
| :: MonadIO m | |
| => LocalOrRemote | |
| -> CodebasePath | |
| -> (Reference -> Transaction ConstructorType) | A |
| -> TVar (Map Hash TermBufferEntry) | |
| -> TVar (Map Hash DeclBufferEntry) | |
| -> Bool | |
| -> BackupStrategy | |
| -> VacuumStrategy | |
| -> Connection | |
| -> m (Either OpenCodebaseError ()) |
Migrates a codebase up to the most recent version known to ucm. This is a No-op if it's up to date Returns an error if the schema version is newer than this ucm knows about.
backupCodebaseIfNecessary :: BackupStrategy -> LocalOrRemote -> Connection -> SchemaVersion -> SchemaVersion -> CodebasePath -> IO () Source #
If we need to make a backup, then copy the sqlite database to a new file with a unique name based on current time.
runIntegrityChecks :: MVar ConsoleRegion -> Transaction () Source #