db

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close() error

Types

type DbConfig

type DbConfig struct {
	Driver   string `json:"driver"`
	User     string `json:"user"`
	Password string `json:"password"`
	Host     string `json:"host"`
	Port     string `json:"port"`
	Database string `json:"database"`
}

type Dbx

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

func Open

func Open(driver string, config string) (*Dbx, error)

func (*Dbx) BeginTx

func (d *Dbx) BeginTx() error

func (*Dbx) ClearTx

func (d *Dbx) ClearTx()

func (*Dbx) Commit

func (d *Dbx) Commit() error

func (*Dbx) Exec

func (d *Dbx) Exec(sql string, args ...interface{}) (sql.Result, error)

func (*Dbx) Query

func (d *Dbx) Query(query string, args ...interface{}) (*sql.Rows, error)

func (*Dbx) QueryRow

func (d *Dbx) QueryRow(query string, args ...interface{}) *sql.Row

func (*Dbx) Rollback

func (c *Dbx) Rollback() error

type NullUint64

type NullUint64 struct {
	Uint64 uint64
	Valid  bool // Valid is true if Uint64 is not NULL
	// contains filtered or unexported fields
}

NullUint64 represents an uint64 that may be null. NullUint64 implements the Scanner interface so it can be used as a scan destination, similar to NullString.

func (*NullUint64) Scan

func (n *NullUint64) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullUint64) Value

func (n NullUint64) Value() (driver.Value, error)

Value implements the driver Valuer interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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