sqlm

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

README

sqlm

介绍

sqlm

软件架构

软件架构说明

安装教程
  1. xxxx
  2. xxxx
  3. xxxx
使用说明
  1. xxxx
  2. xxxx
  3. xxxx
参与贡献
  1. Fork 本仓库
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request
码云特技
  1. 使用 Readme_XXX.md 来支持不同的语言,例如 Readme_en.md, Readme_zh.md
  2. 码云官方博客 blog.gitee.com
  3. 你可以 https://gitee.com/explore 这个地址来了解码云上的优秀开源项目
  4. GVP 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目
  5. 码云官方提供的使用手册 https://gitee.com/help
  6. 码云封面人物是一档用来展示码云会员风采的栏目 https://gitee.com/gitee-stars/

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SQLM

type SQLM struct {
	*sqlx.DB
}

SQLM SQLM

func Conn

func Conn(driverName, dataSourceName string) (sqlm SQLM, err error)

Conn 连接数据库

func (SQLM) Begin

func (s SQLM) Begin() (tx Tx, err error)

Begin 开始事务

func (SQLM) Exec

func (s SQLM) Exec(pattern string, arg interface{}) (result sql.Result, err error)

Exec 执行一次数据操作

func (SQLM) Query

func (s SQLM) Query(pattern string, arg interface{}) (rows *sqlx.Rows, err error)

Query 执行一次多行查询

func (SQLM) QueryRow

func (s SQLM) QueryRow(pattern string, arg interface{}) (row *sqlx.Row, err error)

QueryRow 执行一次单行查询

type Tx

type Tx struct {
	*sqlx.Tx
}

Tx sqlt事务对象

func (Tx) Commit

func (tx Tx) Commit() (err error)

Commit 提交事务

func (Tx) Exec

func (tx Tx) Exec(pattern string, arg interface{}) (result sql.Result, err error)

Exec 在事务中执行一次数据操作

func (Tx) Query

func (tx Tx) Query(pattern string, arg interface{}) (rows *sqlx.Rows, err error)

Query 在事务中执行一次多行查询

func (Tx) QueryRow

func (tx Tx) QueryRow(pattern string, arg interface{}) (row *sqlx.Row, err error)

QueryRow 在事务中执行一次单行查询

func (Tx) Rollback

func (tx Tx) Rollback() (err error)

Rollback 回滚事务

Jump to

Keyboard shortcuts

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