unison-parser-typechecker-0.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Unison.Codebase.SqliteCodebase.Migrations

Synopsis

Documentation

migrations Source #

Arguments

:: MVar ConsoleRegion 
-> (Reference -> Transaction ConstructorType)

A getDeclType-like lookup, possibly backed by a cache.

-> 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.

ensureCodebaseIsUpToDate Source #

Arguments

:: MonadIO m 
=> LocalOrRemote 
-> CodebasePath 
-> (Reference -> Transaction ConstructorType)

A getDeclType-like lookup, possibly backed by a cache.

-> 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.