mysql

package
v0.0.0-...-ff80121 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DSNTemplate = "%s:%s@tcp(%s:%d)/%s?charset=utf8"

Variables

This section is empty.

Functions

func CloseEngine

func CloseEngine() error

CloseEngine Close mysql engine

func Db

func Db() *xorm.Engine

Db get db connection

func DeleteById

func DeleteById(id int64, model interface{}) (affected int64, err error)

DeleteById Usage: user := new(User) num, err := mysql.DeleteById(23, user)

func InitMysql

func InitMysql() (err error)

func UpdateById

func UpdateById(id int64, model interface{}, fields ...string) (affected int64, err error)

UpdateById Update by ID Usage: user := new(User) num, err := mysql.UpdateById(23, user, "name", "email")

Types

This section is empty.

Jump to

Keyboard shortcuts

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