dbutil

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolToBitStr

func BoolToBitStr(b bool) string

BoolToBitStr formats boolean as "0" or "1"

func ExecOne

func ExecOne(tx *sql.Tx, query string, args ...interface{}) (int64, error)

ExecOne executes a query within the given transaction and returns the number of affected rows

func RunSession

func RunSession(driver string, url string, do func(tx *sql.Tx) error)

RunSession runs a simple DB session with all actions enclosed within a transaction

It connects to DB, starts a transaction, calls "do" and then commits it.

Special handling for Azure SQL Server, which are often unavailable temporarily

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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