# 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.
ExecuteCustomScripts executes SQL scripts in files.
ExecuteSchemaScripts executes initial schema scripts.
ExecuteSQLCommand executes chain script with parameters inside transaction.
ExecuteSQLTask executes SQL task.
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.
GetRemoteDBTransaction create a remote db connection and returns transaction object.
HandleNotifications consumes notifications in blocking mode.
InitAndTestConfigDBConnection opens connection and creates schema.
InsertChainRunStatus inits the execution run log, which will be use to effectively control scheduler concurrency.
IsAlive returns true if the connection to the database is alive.
Log performs logging to standard output.
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.
MustRollbackToSavepoint rollbacks transaction to SAVEPOINT and log error in the case of error.
MustRollbackTransaction rollbacks transaction and log error in the case of error.
MustSavepoint creates SAVDEPOINT in transaction and log error in the case of error.
NotificationHandler consumes notifications from the PostgreSQL server.
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.
SelectChain returns the chain with the specified ID.
SelectRebootChains returns a list of chains should be executed after reboot.
SelectIntervalChains returns list of interval chains to be executed.
SelectRebootChains returns a list of chains should be executed after reboot.
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.
WaitForChainSignal returns configuration id from the notifications.
# 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.
WaitTime specifies amount of time in seconds to wait before reconnecting to DB.
# Variables
ClientName is unique ifentifier of the scheduler application running.
ConfigDb is the global database object.
NoProgramTasks parameter disables PROGRAM tasks executing.
NotifyTTL specifies how long processed NOTIFY messages should be stored.
OpenDB opens connection to the database.
VerboseLogLevel specifies if log messages with level LOG should be logged.
# Structs
ChainElementExecution structure describes each chain execution process.
No description provided by the author
Logger incapsulates Logger interface from pgx package.