Documentation
¶
Overview ¶
Package lyspgdb contains functions for monitoring Postgres databases.
Index ¶
- func AddMissingAuditUpdateTriggers(ctx context.Context, ownerDb *pgxpool.Pool, infoLog *slog.Logger) (err error)
- func AddMissingUpdatedAtTriggers(ctx context.Context, ownerDb *pgxpool.Pool, infoLog *slog.Logger) (err error)
- func CheckDb(ctx context.Context, ownerDb *pgxpool.Pool, infoLog, errorLog *slog.Logger) (err error)
- func CheckDuplicateShortnames(ctx context.Context, ownerDb *pgxpool.Pool, errorLog *slog.Logger) (err error)
- func CheckInconsistentArchivedCols(ctx context.Context, ownerDb *pgxpool.Pool, errorLog *slog.Logger) (err error)
- func CheckMissingLastUserUpdateByCols(ctx context.Context, ownerDb *pgxpool.Pool, errorLog *slog.Logger) (err error)
- func Install(ctx context.Context, ownerDb *pgxpool.Pool, dbOwner string, ...) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddMissingAuditUpdateTriggers ¶ added in v0.3.15
func AddMissingAuditUpdateTriggers(ctx context.Context, ownerDb *pgxpool.Pool, infoLog *slog.Logger) (err error)
AddMissingAuditUpdateTriggers adds missing audit update triggers for all tables returned by v_missing_audit_update_trigger
func AddMissingUpdatedAtTriggers ¶ added in v0.2.1
func AddMissingUpdatedAtTriggers(ctx context.Context, ownerDb *pgxpool.Pool, infoLog *slog.Logger) (err error)
AddMissingUpdatedAtTriggers adds missing updated_at triggers for all tables returned by v_missing_updated_at_trigger
func CheckDb ¶ added in v0.3.17
func CheckDb(ctx context.Context, ownerDb *pgxpool.Pool, infoLog, errorLog *slog.Logger) (err error)
CheckDb checks the integrity of the database. It should be run after schema updates and also periodically
func CheckDuplicateShortnames ¶ added in v0.3.2
func CheckDuplicateShortnames(ctx context.Context, ownerDb *pgxpool.Pool, errorLog *slog.Logger) (err error)
CheckDuplicateShortnames checks for tables with the same shortname comment
func CheckInconsistentArchivedCols ¶ added in v0.3.2
func CheckInconsistentArchivedCols(ctx context.Context, ownerDb *pgxpool.Pool, errorLog *slog.Logger) (err error)
CheckInconsistentArchivedCols checks for archived tables that do not have the same cols as their base tables
func CheckMissingLastUserUpdateByCols ¶ added in v0.3.1
func CheckMissingLastUserUpdateByCols(ctx context.Context, ownerDb *pgxpool.Pool, errorLog *slog.Logger) (err error)
CheckMissingLastUserUpdateByCols checks for tables that have the t_audit_update trigger but are missing the last_user_update_by col
func Install ¶
func Install(ctx context.Context, ownerDb *pgxpool.Pool, dbOwner string, infoLog *slog.Logger) (err error)
Install creates the lyspgmon schema in the database if it is not already present, and (re)-adds functions and monitoring views in the lyspgmonddl folder note that local permissions need to be granted to lyspgmon schema and objects after installation
Types ¶
This section is empty.