database

package
v0.0.0-...-1bd4bba Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MySQLConnection

func MySQLConnection() (*sqlx.DB, error)

func OpenDBConnection

func OpenDBConnection() *sqlx.DB

OpenDBConnection func for opening database connection.

func WithTransaction

func WithTransaction(db *sqlx.DB, txFunc func(*sqlx.Tx) error) error

Types

type Hooks

type Hooks struct{}

func (*Hooks) After

func (h *Hooks) After(ctx context.Context, query string, args ...interface{}) (context.Context, error)

After hook will get the timestamp registered on the Before hook and print the elapsed time

func (*Hooks) Before

func (h *Hooks) Before(ctx context.Context, query string, args ...interface{}) (context.Context, error)

Before hook will print the query with it's args and return the context with the timestamp

Jump to

Keyboard shortcuts

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