vsqlx

package
v0.0.0-...-f4de95a Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DriverMySQL      = "mysql"
	DriverPostgreSQL = "postgres"
	DriverMSSQL      = "mssql"

	Null = `null`
)

Variables

This section is empty.

Functions

func HandleErrorRepository

func HandleErrorRepository(errRepo error, errMsg error) error

func InitDatabase

func InitDatabase(config *contract.Config) (*sqlx.DB, error)

func PrepareNamed

func PrepareNamed(db *sqlx.DB, query string) *sqlx.NamedStmt

PrepareNamed prepare sql statements with named bindvars or exit cmd if fails or error

func PrepareStmt

func PrepareStmt(db *sqlx.DB, query string) *sqlx.Stmt

PrepareNamed prepare sql statements with named bindvars or exit cmd if fails or error

func PrepareStmtRebind

func PrepareStmtRebind(db *sqlx.DB, queryFmt string, args ...interface{}) *sqlx.Stmt

PrepareFmtRebind prepare sql statements from string format and rebind variable or exit cmd if fails or error

func ReleaseTx

func ReleaseTx(tx *sqlx.Tx, err *error)

ReleaseTx clean db transaction by commit if no error, or rollback if an error occurred

Types

This section is empty.

Jump to

Keyboard shortcuts

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