db

package
v0.0.0-...-2a57123 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package db provides support for access to a mysql database using the mysql driver

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Open

func Open(config Config) (*sqlx.DB, error)

Open opens a database specified by a configuration struct and a driver-specific data source name, usually consisting of at least a database name and connection information.

func StatusCheck

func StatusCheck(ctx context.Context, db *sqlx.DB) error

StatusCheck returns nil if it can successfully talk to the database. It returns a non-nil error otherwise.

Types

type Config

type Config struct {
	User         string
	Password     string
	Host         string
	Name         string
	Schema       string
	MaxIdleConns int
	MaxOpenConns int
	DisableTLS   bool
}

Config is the required properties to use the database.

Jump to

Keyboard shortcuts

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