ensurer

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IndexEnsurer

type IndexEnsurer interface {
	// EnsureIndexes loads indexes defined sql file and applies it to the database.
	// In case of indexes already existed, no errors will be returned.
	EnsureIndexes(ctx context.Context) error
}

type SQLEnsurer

type SQLEnsurer interface {
	IndexEnsurer
	SchemaEnsurer
	// Close closes database connection held by client.
	Close() error
	Ping() error
}

func NewMySQLEnsurer

func NewMySQLEnsurer(url, database, usernameFile, passwordFile string, logger *zap.Logger) (SQLEnsurer, error)

type SchemaEnsurer

type SchemaEnsurer interface {
	// EnsureSchema loads schema defined sql file and applies it to the database.
	EnsureSchema(ctx context.Context) error
}

Jump to

Keyboard shortcuts

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