db

package module
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2020 License: MIT Imports: 9 Imported by: 0

README

db

operate mysql with go

conf

db.IP = "your ip default 127.0.0.1"
db.Port = "your port default :3306"
db.Uname = "your uname default null"
db.Passwd = "your passwd default null"
db.DB = "your db default null"

read

db.NewRead().XYZ()

write

db.NewWrite().XYZ()

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Read

type Read struct{}

Read Read

func NewRead

func NewRead() *Read

NewRead new read

func (*Read) Item

func (r *Read) Item(query string, args ...interface{}) (*sqlx.Row, error)

Item read item

func (*Read) ItemNamed

func (r *Read) ItemNamed(query string, args interface{}) (*sqlx.Row, error)

ItemNamed read item named

func (*Read) ItemStruct

func (r *Read) ItemStruct(dest interface{}, query string, args ...interface{}) error

ItemStruct read item struct

func (*Read) ItemStructNamed

func (r *Read) ItemStructNamed(dest interface{}, query string, args interface{}) error

ItemStructNamed item struct named

func (*Read) List

func (r *Read) List(query string, args ...interface{}) (*sqlx.Rows, error)

List read list

func (*Read) ListNamed

func (r *Read) ListNamed(query string, args interface{}) (*sqlx.Rows, error)

ListNamed read list named

func (*Read) ListStruct

func (r *Read) ListStruct(dest interface{}, query string, args ...interface{}) error

ListStruct read list struct

func (*Read) ListStructNamed

func (r *Read) ListStructNamed(dest interface{}, query string, args interface{}) error

ListStructNamed list struct named

type Write

type Write struct{}

Write write

func NewWrite

func NewWrite() *Write

NewWrite new *Write

func (*Write) Item

func (w *Write) Item(query string, args ...interface{}) (sql.Result, error)

Item write

func (*Write) ItemNamed

func (w *Write) ItemNamed(query string, args interface{}) (sql.Result, error)

ItemNamed wirte item named

func (*Write) List

func (w *Write) List(query string, args []interface{}) error

List write list

func (*Write) ListNamed

func (w *Write) ListNamed(query string, args []interface{}) error

ListNamed write list named

Jump to

Keyboard shortcuts

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