dblib

package module
v0.1.20 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2021 License: MIT Imports: 13 Imported by: 0

README

Additional custom packages

Documentation

Index

Constants

View Source
const (
	// MYSQL --
	MYSQL = "mysql"
	// PGSQL --
	PGSQL = "postgres"
	// MSSQL --
	MSSQL = "mssql"
)

Variables

This section is empty.

Functions

func GetVals

func GetVals(data interface{}, fieldNames []string) (values []interface{}, err error)

GetVals --

Types

type DB

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

DB --

func (*DB) Exec

func (me *DB) Exec(query string, secured bool, prm ...interface{}) (result sql.Result, err error)

Exec --

func (*DB) Init

func (me *DB) Init(logFacility *log.Facility, driver string, dsn string, maxConn int, maxRetry int) error

Init --

func (*DB) OpenRecordset

func (me *DB) OpenRecordset(query string, secured bool, prm ...interface{}) (result *sql.Rows, err error)

OpenRecordset --

func (*DB) SecureString

func (me *DB) SecureString(s string) string

SecureString --

type DBext

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

DBext --

func NewDBext

func NewDBext(logFacility *log.Facility, cfg *config.DB, queries misc.StringMap) (dbExt *DBext, err error)

NewDBext --

func (*DBext) DB

func (me *DBext) DB() *DB

DB --

func (*DBext) Exec

func (me *DBext) Exec(id uint64, secured bool, name string, params ...interface{}) (result interface{}, code int, err error)

Exec -- execute stored procedure or other

func (*DBext) OpenRecordset

func (me *DBext) OpenRecordset(name string, secured bool, params ...interface{}) (*sql.Rows, error)

OpenRecordset -- fetching data

func (*DBext) OpenRecordsetExtended

func (me *DBext) OpenRecordsetExtended(name string, secured bool, offset uint, count uint, params ...interface{}) (*sql.Rows, error)

OpenRecordsetExtended -- fetching data with providing a start position and max count

func (*DBext) SecureString added in v0.1.11

func (me *DBext) SecureString(s string) string

SecureString --

func (*DBext) Select

func (me *DBext) Select(id uint64, secured bool, rowPattern interface{}, name string, cacheName string, offset uint, count uint, params ...interface{}) (result []interface{}, code int, err error)

Select -- Get data from table or view

type NullBool

type NullBool sql.NullBool

NullBool --

func (NullBool) MarshalJSON

func (v NullBool) MarshalJSON() ([]byte, error)

MarshalJSON for NullBool

func (*NullBool) Scan

func (v *NullBool) Scan(value interface{}) error

Scan --

type NullFloat64

type NullFloat64 sql.NullFloat64

NullFloat64 --

func (NullFloat64) MarshalJSON

func (v NullFloat64) MarshalJSON() ([]byte, error)

MarshalJSON for NullFloat64

func (*NullFloat64) Scan

func (v *NullFloat64) Scan(value interface{}) error

Scan implements the Scanner interface.

type NullInt32 added in v0.1.7

type NullInt32 sql.NullInt32

NullInt32 --

func (NullInt32) MarshalJSON added in v0.1.7

func (v NullInt32) MarshalJSON() ([]byte, error)

MarshalJSON for NullInt32

func (*NullInt32) Scan added in v0.1.7

func (v *NullInt32) Scan(value interface{}) error

Scan implements the Scanner interface.

type NullInt64

type NullInt64 sql.NullInt64

NullInt64 --

func (NullInt64) MarshalJSON

func (v NullInt64) MarshalJSON() ([]byte, error)

MarshalJSON for NullInt64

func (*NullInt64) Scan

func (v *NullInt64) Scan(value interface{}) error

Scan implements the Scanner interface.

type NullString

type NullString sql.NullString

NullString --

func (NullString) MarshalJSON

func (v NullString) MarshalJSON() ([]byte, error)

MarshalJSON for NullString

func (*NullString) Scan

func (v *NullString) Scan(value interface{}) error

Scan implements the Scanner interface.

type NullTime

type NullTime sql.NullTime

NullTime --

func (NullTime) MarshalJSON

func (v NullTime) MarshalJSON() ([]byte, error)

MarshalJSON for NullTime

func (*NullTime) Scan

func (v *NullTime) Scan(value interface{}) error

Scan implements the Scanner interface.

Jump to

Keyboard shortcuts

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