mysql_dao

package
v0.0.0-...-8bc0dfe Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppsDAO

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

func NewAppsDAO

func NewAppsDAO(db *sqlx.DB) *AppsDAO

func (*AppsDAO) Delete

func (dao *AppsDAO) Delete(id int32) (rows int64, err error)

delete from apps where id = :id TODO(@benqi): sqlmap

func (*AppsDAO) Insert

func (dao *AppsDAO) Insert(do *do.AppsDO) (id int64, err error)

insert into apps(api_id, api_hash, title, short_name) values (:api_id, :api_hash, :title, :short_name) TODO(@benqi): sqlmap

func (*AppsDAO) SelectAppsByIdList

func (dao *AppsDAO) SelectAppsByIdList(idList []int32) ([]do.AppsDO, error)

select id, api_id, api_hash, title, short_name from apps where id in (:idList) TODO(@benqi): sqlmap

func (*AppsDAO) SelectById

func (dao *AppsDAO) SelectById(id int32) (*do.AppsDO, error)

select id, api_id, api_hash, title, short_name from apps where id = :id TODO(@benqi): sqlmap

func (*AppsDAO) SelectListById

func (dao *AppsDAO) SelectListById() ([]do.AppsDO, error)

select id, api_id, api_hash, title, short_name from apps limit 10 TODO(@benqi): sqlmap

func (*AppsDAO) Update

func (dao *AppsDAO) Update(title string, id int32) (rows int64, err error)

update apps set title = :title where id = :id TODO(@benqi): sqlmap

type AuthSaltsDAO

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

func NewAuthSaltsDAO

func NewAuthSaltsDAO(db *sqlx.DB) *AuthSaltsDAO

func (*AuthSaltsDAO) Insert

func (dao *AuthSaltsDAO) Insert(do *do.AuthSaltsDO) (id int64, err error)

insert into auth_salts(auth_id, salt) values (:auth_id, :salt) TODO(@benqi): sqlmap

func (*AuthSaltsDAO) SelectByAuthId

func (dao *AuthSaltsDAO) SelectByAuthId(auth_id int64) (*do.AuthSaltsDO, error)

select auth_id, salt from auth_salts where auth_id = :auth_id TODO(@benqi): sqlmap

type MessagesDAO

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

func NewMessagesDAO

func NewMessagesDAO(db *sqlx.DB) *MessagesDAO

func (*MessagesDAO) Insert

func (dao *MessagesDAO) Insert(do *dataobject.MessagesDO) int64

insert into messages(user_id, peer_type, peer_id, random_id, message, date2, created_at) values (:user_id, :peer_type, :peer_id, :random_id, :message, :date2, :created_at) TODO(@benqi): sqlmap

func (*MessagesDAO) SelectByIdList

func (dao *MessagesDAO) SelectByIdList(idList []int32) []dataobject.MessagesDO

select id, user_id, peer_type, peer_id, random_id, message, date2 from messages where id in (:idList) TODO(@benqi): sqlmap

func (*MessagesDAO) SelectByPts

func (dao *MessagesDAO) SelectByPts(user_id int32, pts int32) []map[string]interface{}

select id, user_id, peer_type, peer_id, random_id, message, date2 from messages where id in (select message_id from message_boxs where user_id = :user_id and pts > :pts) TODO(@benqi): sqlmap

func (*MessagesDAO) SelectByUserIdAndPeer

func (dao *MessagesDAO) SelectByUserIdAndPeer(peer_type int32, user_id int32, peer_id int32) []dataobject.MessagesDO

select id, user_id, peer_type, peer_id, random_id, message, date2 from messages where peer_type = :peer_type and (user_id = :user_id and peer_id = :peer_id) or (user_id = :peer_id and peer_id = :user_id) TODO(@benqi): sqlmap

type UsersDAO

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

func NewUsersDAO

func NewUsersDAO(db *sqlx.DB) *UsersDAO

func (*UsersDAO) Insert

func (dao *UsersDAO) Insert(do *do.UsersDO) (id int64, err error)

insert into users(phone) values (:phone) TODO(@benqi): sqlmap

func (*UsersDAO) SelectById

func (dao *UsersDAO) SelectById(id int32) (*do.UsersDO, error)

select id, access_hash, first_name, last_name, username from users where id = :id limit 1 TODO(@benqi): sqlmap

func (*UsersDAO) SelectByPhoneNumber

func (dao *UsersDAO) SelectByPhoneNumber(phone string) (*do.UsersDO, error)

select id, access_hash, first_name, last_name, username from users where phone = :phone limit 1 TODO(@benqi): sqlmap

func (*UsersDAO) SelectByQueryString

func (dao *UsersDAO) SelectByQueryString(username string, first_name string, last_name string, phone string) ([]do.UsersDO, error)

select id, access_hash, first_name, last_name, username, phone from users where username = :username or first_name = :first_name or last_name = :last_name or phone = :phone limit 20 TODO(@benqi): sqlmap

func (*UsersDAO) SelectUsersByIdList

func (dao *UsersDAO) SelectUsersByIdList(id_list []int32) ([]do.UsersDO, error)

select id, access_hash, first_name, last_name, username from users where id in (:id_list) TODO(@benqi): sqlmap

Jump to

Keyboard shortcuts

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