dbsql

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBool added in v0.0.11

func GetBool(value *sql.NullBool) *bool

GetBool returns a valid value from db sql float64, nil otherwise

func GetFloat64 added in v0.0.11

func GetFloat64(value *sql.NullFloat64) *float64

GetFloat64 returns a valid value from db sql float64, nil otherwise

func GetInt64 added in v0.0.11

func GetInt64(value *sql.NullInt64) *int64

GetInt64 returns a valid value from db sql int64, nil otherwise

func GetNullBool added in v0.0.11

func GetNullBool(value *bool) *sql.NullBool

GetNullBool returns a valid value from db sql bool, nil otherwise

func GetNullFloat64 added in v0.0.11

func GetNullFloat64(value *float64) *sql.NullFloat64

GetNullFloat64 returns a valid value from db sql float64, nil otherwise

func GetNullInt64 added in v0.0.11

func GetNullInt64(value *int64) *sql.NullInt64

GetNullInt64 returns a null int64 from a int64

func GetNullString added in v0.0.11

func GetNullString(value *string) *sql.NullString

GetNullString returns a null string from a string

func GetString added in v0.0.11

func GetString(value *sql.NullString) *string

GetString returns a valid value from db sql string, nil otherwise

func NewDBConnection

func NewDBConnection(driverName string, dataSourceName string) (*sql.DB, error)

NewDBConnection creates a new db connection

func Transact

func Transact(DB *sql.DB, fnTransact func(*sql.Tx) error) error

Transact performs a transaction on a given database

func TransactExec

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

TransactExec executes the query with args inside the transaction

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