mysql

package
v0.0.0-...-4b4c4d1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2021 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

Close mysql connection

func Connect

func Connect(addr string, port uint16, user string, password string, dbname string)

Connect to mysql

func Deltet

func Deltet(table string) string

Deltet from database

func Insert

func Insert(table string, kvs []*KeyVal) string

Insert into database

func Limit

func Limit(page uint, column uint) string

Limit statement

func Order

func Order(key string) string

Order statement

func OrderDesc

func OrderDesc(key string) string

OrderDesc statement

func Prepare

func Prepare(query string) (*sql.Stmt, error)

Prepare database

func Query

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

Query database

func Replace

func Replace(table string, kvs []*KeyVal) string

Replace into database

func Select

func Select(table string, args ...[]string) string

Select query

func SubAnd

func SubAnd(kovs []*KeyOpVal) string

SubAnd join to where statement

func SubOr

func SubOr(kovs []*KeyOpVal) string

SubOr join to where statement

func Update

func Update(table string, kvs []*KeyVal) string

Update into database

func Where

func Where(kovs []*KeyOpVal) string

Where statement

func WhereOr

func WhereOr(kovs []*KeyOpVal) string

WhereOr statement

Types

type KeyOpVal

type KeyOpVal struct {
	Key   string
	Op    string
	Value string
}

KeyOpVal for where statement used

type KeyVal

type KeyVal struct {
	Key   string
	Value string
}

KeyVal for insert replace statement used

Jump to

Keyboard shortcuts

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