db

package
v0.64.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package db provides some assistant functions about the database.

Index

Constants

This section is empty.

Variables

View Source
var Connection = gconf.StrOpt("connection", "The URL connection to the sql database, user:password@tcp(ip:port)/db.")

Connection is the configuration option to connect to the sql database.

View Source
var LogLevel = new(slog.LevelVar)

LogLevel is the level to log the sql statement and args.

Functions

func InitMysqlDB

func InitMysqlDB(connURL string, configs ...sqlx.Config) *sqlx.DB

InitMysqlDB initializes the mysql connection.

func LogInterceptor

func LogInterceptor(logargs bool) sqlx.Config

LogInterceptor returns a Config to set the log interceptor for sqlx.DB.

func OnExit

func OnExit() sqlx.Config

OnExit returns a Config to register a close callback which will be called when the program exits.

Types

This section is empty.

Jump to

Keyboard shortcuts

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