Documentation ¶
Index ¶
- type SqlDB
- func (s *SqlDB) ClearAll(table string) error
- func (s *SqlDB) Close() error
- func (s *SqlDB) Delete(cond interface{}) (int64, error)
- func (s *SqlDB) Exist(cond interface{}) (bool, error)
- func (s *SqlDB) InsertOne(data interface{}) (int64, error)
- func (s *SqlDB) SelectAll(output interface{}, cond ...interface{}) error
- func (s *SqlDB) SelectOne(condAndOutput interface{}) (bool, error)
- func (s *SqlDB) Tables() ([]string, error)
- func (s *SqlDB) UpdateOne(data, cond interface{}) (int64, error)
- func (s *SqlDB) UpsertOne(data, cond interface{}) (int64, error)
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 (*SqlDB) Delete ¶
根据cond结构体中存在的非空数据来删除记录,同时cond也是要目标table名 此接口只允许根据某个属性的特定值进行删除,不允许空条件或者条件中的字段为空,如果条件中有多个字段,则必须同时满足 如果要删除全部内容,而不是根据某个属性的特定值进行删除,那么应该使用Clear接口
func (*SqlDB) Exist ¶
根据cond结构体中存在的非空数据来查询是否存在,同时cond也是要目标table名 table: use to known which table to query
Click to show internal directories.
Click to hide internal directories.