db

package
v0.0.0-...-f81cca4 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn struct {
	DriverName string
	Dsn        string
	DbName     string
	// contains filtered or unexported fields
}

func (*Conn) Connect

func (t *Conn) Connect(driverName, dsn, dbName string) (err error)

func (*Conn) Job

func (t *Conn) Job() *Job

func (*Conn) Raw

func (t *Conn) Raw() *sql.DB

func (*Conn) SetOpenConns

func (t *Conn) SetOpenConns(openConns, idleConns int)

func (*Conn) TxJob

func (t *Conn) TxJob(isoLevel sql.IsolationLevel, readonly bool) (job *Job, err error)

func (*Conn) TxJobFunc

func (t *Conn) TxJobFunc(isoLevel sql.IsolationLevel, readonly bool, fn func(*Job) error) (err error)

type Job

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

func NewJob

func NewJob(db *sql.DB) *Job

db or tx

func (*Job) BeginTx

func (t *Job) BeginTx(isoLevel sql.IsolationLevel, readonly bool) error

func (*Job) Commit

func (t *Job) Commit() error

func (*Job) Exec

func (t *Job) Exec(query string, args ...interface{}) (res sql.Result, err error)

func (*Job) Query

func (t *Job) Query(query string, args ...interface{}) (rows *sql.Rows, err error)

func (*Job) Rollback

func (t *Job) Rollback() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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