# Functions

CanProceedChainExecution checks if particular chain can be exeuted in parallel.
CheckNeedMigrateDb checks need of upgrading database and throws error if that's true.
DeleteChainConfig delete chaing configuration for self destructive chains.
ExecuteSQLCommand executes chain script with parameters inside transaction.
FinalizeConfigDBConnection closes session.
FinalizeRemoteDBConnection closes session.
FixSchedulerCrash make sure that task chains which are not complete due to a scheduler crash are "fixed" and marked as stopped at a certain point */.
GetChainElements returns all elements for a given chain.
GetChainParamValues returns parameter values to pass for task being executed.
GetConnectionString of database_connection.
GetLogPrefix perform formatted logging.
GetLogPrefixLn perform formatted logging with new line at the end.
GetRemoteDBTransaction create a remote db connection and returns transaction object.
InitAndTestConfigDBConnection opens connection and creates schema.
InsertChainRunStatus inits the execution run log, which will be use to effectively control scheduler concurrency.
LogChainElementExecution will log current chain element execution status including retcode.
LogToDB performs logging to configuration database ConfigDB initiated during bootstrap.
MigrateDb upgrades database with all migrations.
MustCommitTransaction commits transaction and log error in the case of error.
MustRollbackTransaction rollbacks transaction and log error in the case of error.
ReconnectDbAndFixLeftovers keeps trying reconnecting every `waitTime` seconds till connection established.
ResetRole - RESET forms reset the current user identifier to be the current session user identifier.
SetRole - set the current user identifier of the current session.
SetupCloseHandler creates a 'listener' on a new goroutine which will notify the program if it receives an interrupt from the OS.
StartTransaction return transaction object and panic in the case of error.
TryLockClientName obtains lock on the server to prevent another client with the same name.
UpdateChainRunStatus inserts status information about running chain elements.

# Constants

AppID used as a key for obtaining locks on the server, it's Adler32 hash of 'pg_timetable' string.
InvalidOid specifies value for non-existent objects.

# Variables

ClientName is unique ifentifier of the scheduler application running.
ConfigDb is the global database object.
DbName is used to reconnect to data base.
Host is used to reconnect to data base.
Password is used to Reconnect Data base.
Port is used to reconnect to data base.
SSLMode parameter determines whether or with what priority a secure SSL TCP/IP connection will be negotiated with the server.
Upgrade parameter specifies if database should be upgraded to latest version.
User is used to reconnect to data base.
VerboseLogLevel specifies if log messages with level LOG should be logged.

# Structs

ChainElementExecution structure describes each chain execution process.