gsqldb

package
v0.0.0-...-f3abbe6 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SqlDB

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

func Dial

func Dial(dvr gdriver.Driver, connectString string) (*SqlDB, error)

func (*SqlDB) ClearAll

func (s *SqlDB) ClearAll(table string) error

清空表格内容

func (*SqlDB) Close

func (s *SqlDB) Close() error

func (*SqlDB) Delete

func (s *SqlDB) Delete(cond interface{}) (int64, error)

根据cond结构体中存在的非空数据来删除记录,同时cond也是要目标table名 此接口只允许根据某个属性的特定值进行删除,不允许空条件或者条件中的字段为空,如果条件中有多个字段,则必须同时满足 如果要删除全部内容,而不是根据某个属性的特定值进行删除,那么应该使用Clear接口

func (*SqlDB) Exist

func (s *SqlDB) Exist(cond interface{}) (bool, error)

根据cond结构体中存在的非空数据来查询是否存在,同时cond也是要目标table名 table: use to known which table to query

func (*SqlDB) InsertOne

func (s *SqlDB) InsertOne(data interface{}) (int64, error)

插入单条数据

func (*SqlDB) SelectAll

func (s *SqlDB) SelectAll(output interface{}, cond ...interface{}) error

根据cond...结构体中存在的非空数据来查询全部数据

func (*SqlDB) SelectOne

func (s *SqlDB) SelectOne(condAndOutput interface{}) (bool, error)

根据结构体中存在的非空数据来查询单条数据

func (*SqlDB) Tables

func (s *SqlDB) Tables() ([]string, error)

func (*SqlDB) UpdateOne

func (s *SqlDB) UpdateOne(data, cond interface{}) (int64, error)

根据cond...结构体中存在的非空数据来Update单条数据

func (*SqlDB) UpsertOne

func (s *SqlDB) UpsertOne(data, cond interface{}) (int64, error)

根据cond...结构体中存在的非空数据来Upsert单条数据

Jump to

Keyboard shortcuts

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