db

package
v0.0.0-...-e388c68 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2023 License: MIT Imports: 2 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

type Checker struct {
	CheckSQL   string
	VersionSQL string
	DB         *sql.DB
}

Checker is a checker that check a database connection

func NewChecker

func NewChecker(checkSQL, versionSQL string, db *sql.DB) Checker

NewChecker returns a new db.Checker with the given URL

func NewMySQLChecker

func NewMySQLChecker(db *sql.DB) Checker

NewMySQLChecker returns a new db.Checker configured for use in MySQL

func NewPostgreSQLChecker

func NewPostgreSQLChecker(db *sql.DB) Checker

NewPostgreSQLChecker returns a new db.Checker configured for use in PostgreSQL

func NewSqlite3Checker

func NewSqlite3Checker(db *sql.DB) Checker

NewSqlite3Checker returns a new db.Checker configured for use in Sqlite3

func (Checker) Check

func (c Checker) Check() health.Health

Check execute two queries in the database The first is a simple one used to verify if the database is up If is Up then another query is executed, querying for the database version

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL