mssql

package module
v0.0.0-...-bd61050 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLogger

func SetLogger(l zerolog.Logger)

SetLogger set zerolog logger for logging database events

Types

type DB

type DB struct {
	// contains filtered or unexported fields
}

DB holds database connections

func InitDbPool

func InitDbPool(reader, writer DbConfig) *DB

InitDbPool Initialize database connection ppol for PostgreSQL database

func (*DB) CloseDbPool

func (db *DB) CloseDbPool()

CloseDbPool close database connection. Must be called to release connections before exiting from client.

func (*DB) Conn

func (db *DB) Conn(readonly bool) *sql.DB

Conn provide reader or writer connection as per readonly state

type DbConfig

type DbConfig struct {
	DbHost string
	DbPort uint16
	DbName string
	DbUser string
	DbPwd  string
	//DbTimeout is Connection timeout in seconds
	//if could not connect to server in given time then giveup and raise error
	DbTimeout int
	//DbSSLMode flag to enable disable SSL for database connection
	DbSSLMode string
}

DbConfig is config for disk persistent database

Jump to

Keyboard shortcuts

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