mysql_dao

package
v0.0.0-...-e41513e Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2020 License: Apache-2.0 Imports: 6 Imported by: 1

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) Insert

func (dao *AppsDAO) Insert(do *dataobject.AppsDO) int64

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

func (*AppsDAO) SelectById

func (dao *AppsDAO) SelectById(id int32) *dataobject.AppsDO

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

type AuthChannelUpdatesStateDAO

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

func NewAuthChannelUpdatesStateDAO

func NewAuthChannelUpdatesStateDAO(db *sqlx.DB) *AuthChannelUpdatesStateDAO

func (*AuthChannelUpdatesStateDAO) Insert

insert into auth_channel_updates_state(auth_key_id, user_id, channel_id, pts, pts2, `date`) values (:auth_key_id, :user_id, :channel_id, :pts, :pts2, :date) TODO(@benqi): sqlmap

func (*AuthChannelUpdatesStateDAO) SelectByAuthId

func (dao *AuthChannelUpdatesStateDAO) SelectByAuthId(auth_key_id int64, channel_id int32) *dataobject.AuthChannelUpdatesStateDO

select auth_key_id, user_id, channel_id, pts, pts2, `date` from auth_channel_updates_state where auth_key_id = :auth_key_id and channel_id = :channel_id TODO(@benqi): sqlmap

func (*AuthChannelUpdatesStateDAO) UpdateChannelPts

func (dao *AuthChannelUpdatesStateDAO) UpdateChannelPts(pts int32, auth_key_id int64, channel_id int32) int64

update auth_channel_updates_state set pts = :pts, pts2 = :pts where auth_key_id = :auth_key_id and channel_id = :channel_id TODO(@benqi): sqlmap

func (*AuthChannelUpdatesStateDAO) UpdateChannelPts2

func (dao *AuthChannelUpdatesStateDAO) UpdateChannelPts2(pts2 int32, auth_key_id int64, channel_id int32) int64

update auth_channel_updates_state set pts2 = :pts2 where auth_key_id = :auth_key_id and channel_id = :channel_id TODO(@benqi): sqlmap

type AuthKeysDAO

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

func NewAuthKeysDAO

func NewAuthKeysDAO(db *sqlx.DB) *AuthKeysDAO

func (*AuthKeysDAO) Insert

func (dao *AuthKeysDAO) Insert(do *dataobject.AuthKeysDO) int64

insert into auth_keys(auth_id, body) values (:auth_id, :body) TODO(@benqi): sqlmap

func (*AuthKeysDAO) SelectByAuthId

func (dao *AuthKeysDAO) SelectByAuthId(auth_id int64) *dataobject.AuthKeysDO

select body from auth_keys where auth_id = :auth_id TODO(@benqi): sqlmap

type AuthPhoneTransactionsDAO

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

func NewAuthPhoneTransactionsDAO

func NewAuthPhoneTransactionsDAO(db *sqlx.DB) *AuthPhoneTransactionsDAO

func (*AuthPhoneTransactionsDAO) Delete

func (dao *AuthPhoneTransactionsDAO) Delete(state int8, auth_key_id int64, phone_number string, transaction_hash string) int64

update auth_phone_transactions set state = :state where auth_key_id = :auth_key_id and phone_number = :phone_number and transaction_hash = :transaction_hash TODO(@benqi): sqlmap

func (*AuthPhoneTransactionsDAO) Insert

insert into auth_phone_transactions(auth_key_id, phone_number, code, code_expired, transaction_hash, sent_code_type, flash_call_pattern, next_code_type, state, api_id, api_hash, created_time) values (:auth_key_id, :phone_number, :code, :code_expired, :transaction_hash, :sent_code_type, :flash_call_pattern, :next_code_type, :state, :api_id, :api_hash, :created_time) TODO(@benqi): sqlmap

func (*AuthPhoneTransactionsDAO) SelectByPhoneCodeHash

func (dao *AuthPhoneTransactionsDAO) SelectByPhoneCodeHash(auth_key_id int64, phone_number string, transaction_hash string) *dataobject.AuthPhoneTransactionsDO

select id, code, code_expired, sent_code_type, flash_call_pattern, next_code_type, attempts, state from auth_phone_transactions where auth_key_id = :auth_key_id and phone_number = :phone_number and transaction_hash = :transaction_hash TODO(@benqi): sqlmap

func (*AuthPhoneTransactionsDAO) UpdateAttempts

func (dao *AuthPhoneTransactionsDAO) UpdateAttempts(id int64) int64

update auth_phone_transactions set attempts = attempts + 1 where id = :id TODO(@benqi): sqlmap

func (*AuthPhoneTransactionsDAO) UpdateState

func (dao *AuthPhoneTransactionsDAO) UpdateState(state int8, id int64) int64

update auth_phone_transactions set state = :state where id = :id TODO(@benqi): sqlmap

type AuthSeqUpdatesDAO

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

func NewAuthSeqUpdatesDAO

func NewAuthSeqUpdatesDAO(db *sqlx.DB) *AuthSeqUpdatesDAO

func (*AuthSeqUpdatesDAO) Insert

insert into auth_seq_updates(auth_id, user_id, seq, update_type, update_data, date2) values (:auth_id, :user_id, :seq, :update_type, :update_data, :date2) TODO(@benqi): sqlmap

func (*AuthSeqUpdatesDAO) SelectByGtSeq

func (dao *AuthSeqUpdatesDAO) SelectByGtSeq(auth_id int64, user_id int32, seq int32) []dataobject.AuthSeqUpdatesDO

select auth_id, user_id, seq, update_type, update_data, date2 from user_seq_updates where auth_id = :auth_id and user_id = :user_id and seq > :seq order by seq asc TODO(@benqi): sqlmap

func (*AuthSeqUpdatesDAO) SelectLastSeq

func (dao *AuthSeqUpdatesDAO) SelectLastSeq(auth_id int64, user_id int32) *dataobject.AuthSeqUpdatesDO

select seq from auth_seq_updates where auth_id = :auth_id and user_id = :user_id order by seq desc limit 1 TODO(@benqi): sqlmap

type AuthUpdatesStateDAO

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

func NewAuthUpdatesStateDAO

func NewAuthUpdatesStateDAO(db *sqlx.DB) *AuthUpdatesStateDAO

func (*AuthUpdatesStateDAO) Insert

insert into auth_updates_state(auth_key_id, user_id, pts, pts2, qts, qts2, seq, seq2, `date`) values (:auth_key_id, :user_id, :pts, :pts2, :qts, :qts2, :seq, :seq2, :date) TODO(@benqi): sqlmap

func (*AuthUpdatesStateDAO) SelectByAuthId

func (dao *AuthUpdatesStateDAO) SelectByAuthId(auth_key_id int64) *dataobject.AuthUpdatesStateDO

select pts, pts2, qts, qts2, seq, seq2, `date` from auth_updates_state where auth_key_id = :auth_key_id TODO(@benqi): sqlmap

func (*AuthUpdatesStateDAO) UpdatePts2AndQts2

func (dao *AuthUpdatesStateDAO) UpdatePts2AndQts2(pts2 int32, qts2 int32, auth_key_id int64) int64

update auth_updates_state set pts2 = :pts2, qts2 = :qts2 where auth_key_id = :auth_key_id TODO(@benqi): sqlmap

func (*AuthUpdatesStateDAO) UpdatePtsAndQts

func (dao *AuthUpdatesStateDAO) UpdatePtsAndQts(pts int32, qts int32, auth_key_id int64) int64

update auth_updates_state set pts = :pts, pts2 = :pts, qts = :qts, qts2 = :qts where auth_key_id = :auth_key_id TODO(@benqi): sqlmap

type AuthUsersDAO

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

func NewAuthUsersDAO

func NewAuthUsersDAO(db *sqlx.DB) *AuthUsersDAO

func (*AuthUsersDAO) Delete

func (dao *AuthUsersDAO) Delete(deleted_at int64, auth_id int64) int64

update auth_users set deleted_at = :deleted_at where auth_id = :auth_id TODO(@benqi): sqlmap

func (*AuthUsersDAO) Insert

func (dao *AuthUsersDAO) Insert(do *dataobject.AuthUsersDO) int64

insert into auth_users(auth_id, user_id, hash, device_model, platform, system_version, api_id, app_name, app_version, date_created, date_active, ip, country, region) values (:auth_id, :user_id, :hash, :device_model, :platform, :system_version, :api_id, :app_name, :app_version, :date_created, :date_active, :ip, :country, :region) TODO(@benqi): sqlmap

func (*AuthUsersDAO) SelectByAuthId

func (dao *AuthUsersDAO) SelectByAuthId(auth_id int64) *dataobject.AuthUsersDO

select auth_id, user_id, hash, device_model, platform, system_version, api_id, app_name, app_version, date_created, date_active, ip, country, region from auth_users where auth_id = :auth_id TODO(@benqi): sqlmap

func (*AuthUsersDAO) SelectByHash

func (dao *AuthUsersDAO) SelectByHash(user_id int32, hash int64) *dataobject.AuthUsersDO

select auth_id, user_id, hash, device_model, platform, system_version, api_id, app_name, app_version, date_created, date_active, ip, country, region from auth_users where user_id = :user_id and hash = :hash TODO(@benqi): sqlmap

func (*AuthUsersDAO) SelectListByUserId

func (dao *AuthUsersDAO) SelectListByUserId(user_id int32) []dataobject.AuthUsersDO

select auth_id, user_id, hash, device_model, platform, system_version, api_id, app_name, app_version, date_created, date_active, ip, country, region from auth_users where user_id = :user_id order by date_active desc limit 6 TODO(@benqi): sqlmap

func (*AuthUsersDAO) Update

func (dao *AuthUsersDAO) Update(date_active int32, ip string, country string, region string, auth_id int64) int64

update auth_users set date_active = :date_active, ip = :ip, country = :country, region = :region where auth_id = :auth_id TODO(@benqi): sqlmap

type AuthsDAO

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

func NewAuthsDAO

func NewAuthsDAO(db *sqlx.DB) *AuthsDAO

func (*AuthsDAO) Insert

func (dao *AuthsDAO) Insert(do *dataobject.AuthsDO) int64

insert into auths(auth_id, api_id, device_model, system_version, app_version, system_lang_code, lang_pack, lang_code, connection_hash) values (:auth_id, :api_id, :device_model, :system_version, :app_version, :system_lang_code, :lang_pack, :lang_code, :connection_hash) TODO(@benqi): sqlmap

func (*AuthsDAO) SelectConnectionHashByAuthId

func (dao *AuthsDAO) SelectConnectionHashByAuthId(auth_id int64) *dataobject.AuthsDO

select connection_hash from auths where auth_id = :auth_id TODO(@benqi): sqlmap

type BannedDAO

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

func NewBannedDAO

func NewBannedDAO(db *sqlx.DB) *BannedDAO

func (*BannedDAO) CheckBannedByPhone

func (dao *BannedDAO) CheckBannedByPhone(phone string) *dataobject.BannedDO

select id from banned where phone = :phone TODO(@benqi): sqlmap

type ChannelMediaUnreadDAO

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

func NewChannelMediaUnreadDAO

func NewChannelMediaUnreadDAO(db *sqlx.DB) *ChannelMediaUnreadDAO

func (*ChannelMediaUnreadDAO) Insert

insert into channel_media_unread(user_id, channel_id, channel_message_id, media_unread) values (:user_id, :channel_id, :channel_message_id, :media_unread) TODO(@benqi): sqlmap

func (*ChannelMediaUnreadDAO) SelectMediaUnread

func (dao *ChannelMediaUnreadDAO) SelectMediaUnread(user_id int32, channel_id int32, channel_message_id int32) *dataobject.ChannelMediaUnreadDO

select media_unread from channel_media_unread where user_id = :user_id and channel_id = :channel_id and channel_message_id = :channel_message_id TODO(@benqi): sqlmap

func (*ChannelMediaUnreadDAO) UpdateMediaUnread

func (dao *ChannelMediaUnreadDAO) UpdateMediaUnread(user_id int32, channel_id int32, channel_message_id int32) int64

update channel_media_unread set media_unread = 0 where user_id = :user_id and channel_id = :channel_id and channel_message_id = :channel_message_id TODO(@benqi): sqlmap

type ChannelMessageBoxesDAO

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

func NewChannelMessageBoxesDAO

func NewChannelMessageBoxesDAO(db *sqlx.DB) *ChannelMessageBoxesDAO

func (*ChannelMessageBoxesDAO) Insert

insert into channel_message_boxes(sender_user_id, channel_id, channel_message_box_id, message_id, `date`) values (:sender_user_id, :channel_id, :channel_message_box_id, :message_id, :date) TODO(@benqi): sqlmap

func (*ChannelMessageBoxesDAO) SelectBackwardByOffsetLimit

func (dao *ChannelMessageBoxesDAO) SelectBackwardByOffsetLimit(channel_id int32, channel_message_box_id int32, limit int32) []dataobject.ChannelMessageBoxesDO

select sender_user_id, channel_id, channel_message_box_id, message_id, `date` from channel_message_boxes where channel_id = :channel_id and channel_message_box_id < :channel_message_box_id and deleted = 0 order by channel_message_box_id desc limit :limit TODO(@benqi): sqlmap

func (*ChannelMessageBoxesDAO) SelectByMessageId

func (dao *ChannelMessageBoxesDAO) SelectByMessageId(channel_id int32, channel_message_box_id int32) *dataobject.ChannelMessageBoxesDO

select sender_user_id, channel_id, channel_message_box_id, message_id, `date` from channel_message_boxes where channel_id = :channel_id and channel_message_box_id = :channel_message_box_id and deleted = 0 limit 1 TODO(@benqi): sqlmap

func (*ChannelMessageBoxesDAO) SelectByMessageIdList

func (dao *ChannelMessageBoxesDAO) SelectByMessageIdList(channel_id int32, idList []int32) []dataobject.ChannelMessageBoxesDO

select sender_user_id, channel_id, channel_message_box_id, message_id, `date` from channel_message_boxes where channel_id = :channel_id and deleted = 0 and channel_message_box_id in (:idList) order by channel_message_box_id desc TODO(@benqi): sqlmap

func (*ChannelMessageBoxesDAO) SelectForwardByOffsetLimit

func (dao *ChannelMessageBoxesDAO) SelectForwardByOffsetLimit(channel_id int32, channel_message_box_id int32, limit int32) []dataobject.ChannelMessageBoxesDO

select sender_user_id, channel_id, channel_message_box_id, message_id, `date` from channel_message_boxes where channel_id = :channel_id and channel_message_box_id >= :channel_message_box_id and deleted = 0 order by channel_message_box_id asc limit :limit TODO(@benqi): sqlmap

type ChannelMessagesDAO

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

func NewChannelMessagesDAO

func NewChannelMessagesDAO(db *sqlx.DB) *ChannelMessagesDAO

func (*ChannelMessagesDAO) Insert

insert ignore into channel_messages(channel_id, channel_message_id, sender_user_id, random_id, message_data_id, message_type, message_data, has_media_unread, edit_message, edit_date, views, `date`) values (:channel_id, :channel_message_id, :sender_user_id, :random_id, :message_data_id, :message_type, :message_data, :has_media_unread, :edit_message, :edit_date, :views, :date) TODO(@benqi): sqlmap

func (*ChannelMessagesDAO) SelectBackwardByOffsetLimit

func (dao *ChannelMessagesDAO) SelectBackwardByOffsetLimit(channel_id int32, channel_message_id int32, limit int32) []dataobject.ChannelMessagesDO

select channel_id, channel_message_id, sender_user_id, random_id, message_data_id, message_type, message_data, has_media_unread, edit_message, edit_date, views, `date` from channel_messages where channel_id = :channel_id and channel_message_id < :channel_message_id and deleted = 0 order by channel_message_id desc limit :limit TODO(@benqi): sqlmap

func (*ChannelMessagesDAO) SelectByMessageId

func (dao *ChannelMessagesDAO) SelectByMessageId(channel_id int32, channel_message_id int32) *dataobject.ChannelMessagesDO

select channel_id, channel_message_id, sender_user_id, random_id, message_data_id, message_type, message_data, has_media_unread, edit_message, edit_date, views, `date` from channel_messages where channel_id = :channel_id and channel_message_id = :channel_message_id and deleted = 0 limit 1 TODO(@benqi): sqlmap

func (*ChannelMessagesDAO) SelectByMessageIdList

func (dao *ChannelMessagesDAO) SelectByMessageIdList(channel_id int32, idList []int32) []dataobject.ChannelMessagesDO

select channel_id, channel_message_id, sender_user_id, random_id, message_data_id, message_type, message_data, has_media_unread, edit_message, edit_date, views, `date` from channel_messages where channel_id = :channel_id and deleted = 0 and channel_message_id in (:idList) order by channel_message_id desc TODO(@benqi): sqlmap

func (*ChannelMessagesDAO) SelectByRandomId

func (dao *ChannelMessagesDAO) SelectByRandomId(sender_user_id int32, random_id int64) *dataobject.ChannelMessagesDO

select channel_id, channel_message_id, sender_user_id, random_id, message_data_id, message_type, message_data, has_media_unread, edit_message, edit_date, views, `date` from channel_messages where sender_user_id = :sender_user_id and random_id = :random_id TODO(@benqi): sqlmap

func (*ChannelMessagesDAO) SelectForwardByOffsetLimit

func (dao *ChannelMessagesDAO) SelectForwardByOffsetLimit(channel_id int32, channel_message_id int32, limit int32) []dataobject.ChannelMessagesDO

select channel_id, channel_message_id, sender_user_id, random_id, message_data_id, message_type, message_data, has_media_unread, edit_message, edit_date, views, `date` from channel_messages where channel_id = :channel_id and channel_message_id >= :channel_message_id and deleted = 0 order by channel_message_id asc limit :limit TODO(@benqi): sqlmap

func (*ChannelMessagesDAO) SelectMessagesViews

func (dao *ChannelMessagesDAO) SelectMessagesViews(channel_id int32, idList []int32) []dataobject.ChannelMessagesDO

select channel_message_id, views from channel_messages where channel_id = :channel_id and channel_message_id in (:idList) TODO(@benqi): sqlmap

func (*ChannelMessagesDAO) UpdateMessagesViews

func (dao *ChannelMessagesDAO) UpdateMessagesViews(channel_id int32, idList []int32) int64

update channel_messages set views = views + 1 where channel_id = :channel_id and channel_message_id in (:idList) TODO(@benqi): sqlmap

type ChannelParticipantsDAO

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

func NewChannelParticipantsDAO

func NewChannelParticipantsDAO(db *sqlx.DB) *ChannelParticipantsDAO

func (*ChannelParticipantsDAO) Insert

insert into channel_participants(channel_id, user_id, is_creator, inviter_user_id, invited_at, joined_at, promoted_by, admin_rights, promoted_at, kicked_by, banned_rights, banned_until_date, banned_at) values (:channel_id, :user_id, :is_creator, :inviter_user_id, :invited_at, :joined_at, :promoted_by, :admin_rights, :promoted_at, :kicked_by, :banned_rights, :banned_until_date, :banned_at) TODO(@benqi): sqlmap

func (*ChannelParticipantsDAO) InsertOrUpdate

insert into channel_participants(channel_id, user_id, inviter_user_id, invited_at, joined_at) values (:channel_id, :user_id, :inviter_user_id, :invited_at, :joined_at) on duplicate key update participant_type = values(participant_type), inviter_user_id = values(inviter_user_id), invited_at = values(inviter_user_id), joined_at = values(joined_at), promoted_by = 0, admin_rights = 0, promoted_at = 0, is_left = 0, left_at = 0, kicked_by = 0, banned_rights = 0, banned_until_date = 0, banned_at = 0 TODO(@benqi): sqlmap

func (*ChannelParticipantsDAO) SelectByChannelId

func (dao *ChannelParticipantsDAO) SelectByChannelId(channel_id int32) []dataobject.ChannelParticipantsDO

select channel_id, user_id, is_creator, inviter_user_id, invited_at, joined_at, promoted_by, admin_rights, promoted_at, is_left, left_at, kicked_by, banned_rights, banned_until_date, banned_at from channel_participants where channel_id = :channel_id TODO(@benqi): sqlmap

func (*ChannelParticipantsDAO) SelectByUserId

func (dao *ChannelParticipantsDAO) SelectByUserId(channel_id int32, user_id int32) *dataobject.ChannelParticipantsDO

select channel_id, user_id, is_creator, inviter_user_id, invited_at, joined_at, promoted_by, admin_rights, promoted_at, is_left, left_at, kicked_by, banned_rights, banned_until_date, banned_at from channel_participants where channel_id = :channel_id and user_id = :user_id TODO(@benqi): sqlmap

func (*ChannelParticipantsDAO) SelectByUserIdList

func (dao *ChannelParticipantsDAO) SelectByUserIdList(channel_id int32, idList []int32) []dataobject.ChannelParticipantsDO

select channel_id, user_id, is_creator, inviter_user_id, invited_at, joined_at, promoted_by, admin_rights, promoted_at, is_left, left_at, kicked_by, banned_rights, banned_until_date, banned_at from channel_participants where channel_id = :channel_id and user_id in (:idList) TODO(@benqi): sqlmap

func (*ChannelParticipantsDAO) UpdateAdminRights

func (dao *ChannelParticipantsDAO) UpdateAdminRights(admin_rights int32, channel_id int32, user_id int32) int64

update channel_participants set admin_rights = :admin_rights where channel_id = :channel_id and user_id = :user_id TODO(@benqi): sqlmap

func (*ChannelParticipantsDAO) UpdateBannedRights

func (dao *ChannelParticipantsDAO) UpdateBannedRights(banned_rights int32, banned_until_date int32, channel_id int32, user_id int32) int64

update channel_participants set banned_rights = :banned_rights, banned_until_date = :banned_until_date where channel_id = :channel_id and user_id = :user_id TODO(@benqi): sqlmap

func (*ChannelParticipantsDAO) UpdateLeave

func (dao *ChannelParticipantsDAO) UpdateLeave(left_at int32, channel_id int32, user_id int32) int64

update channel_participants set is_left = 1, left_at = :left_at where channel_id = :channel_id and user_id = :user_id TODO(@benqi): sqlmap

func (*ChannelParticipantsDAO) UpdateReadInboxMaxId

func (dao *ChannelParticipantsDAO) UpdateReadInboxMaxId(read_inbox_max_id int32, channel_id int32, user_id int32) int64

update channel_participants set read_inbox_max_id = :read_inbox_max_id where channel_id = :channel_id and user_id = :user_id TODO(@benqi): sqlmap

func (*ChannelParticipantsDAO) UpdateReadOutboxMaxId

func (dao *ChannelParticipantsDAO) UpdateReadOutboxMaxId(read_inbox_max_id int32, channel_id int32, user_id int32) int64

update channel_participants set read_outbox_max_id = :read_inbox_max_id where channel_id = :channel_id and user_id = :user_id TODO(@benqi): sqlmap

type ChannelPtsUpdatesDAO

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

func NewChannelPtsUpdatesDAO

func NewChannelPtsUpdatesDAO(db *sqlx.DB) *ChannelPtsUpdatesDAO

func (*ChannelPtsUpdatesDAO) Insert

insert into channel_pts_updates(channel_id, pts, pts_count, update_type, update_data, date2) values (:channel_id, :pts, :pts_count, :update_type, :update_data, :date2) TODO(@benqi): sqlmap

func (*ChannelPtsUpdatesDAO) SelectByGtPts

func (dao *ChannelPtsUpdatesDAO) SelectByGtPts(channel_id int32, pts int32) []dataobject.ChannelPtsUpdatesDO

select channel_id, pts, pts_count, update_type, update_data from channel_pts_updates where channel_id = :channel_id and pts > :pts order by pts asc TODO(@benqi): sqlmap

func (*ChannelPtsUpdatesDAO) SelectLastPts

func (dao *ChannelPtsUpdatesDAO) SelectLastPts(channel_id int32) *dataobject.ChannelPtsUpdatesDO

select pts from channel_pts_updates where channel_id = :channel_id order by pts desc limit 1 TODO(@benqi): sqlmap

type ChannelsDAO

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

func NewChannelsDAO

func NewChannelsDAO(db *sqlx.DB) *ChannelsDAO

func (*ChannelsDAO) Insert

func (dao *ChannelsDAO) Insert(do *dataobject.ChannelsDO) int64

insert into channels(creator_user_id, access_hash, random_id, participant_count, title, about, broadcast, megagroup, democracy, signatures, `date`) values (:creator_user_id, :access_hash, :random_id, :participant_count, :title, :about, :broadcast, :megagroup, :democracy, :signatures, :date) TODO(@benqi): sqlmap

func (*ChannelsDAO) Select

func (dao *ChannelsDAO) Select(id int32) *dataobject.ChannelsDO

select id, creator_user_id, access_hash, random_id, top_message, participant_count, title, about, photo_id, link, broadcast, megagroup, democracy, signatures, admins_enabled, deactivated, version, `date` from channels where id = :id TODO(@benqi): sqlmap

func (*ChannelsDAO) SelectByIdList

func (dao *ChannelsDAO) SelectByIdList(idList []int32) []dataobject.ChannelsDO

select id, creator_user_id, access_hash, random_id, top_message, participant_count, title, about, photo_id, link, broadcast, megagroup, democracy, signatures, admins_enabled, deactivated, version, `date` from channels where id in (:idList) TODO(@benqi): sqlmap

func (dao *ChannelsDAO) SelectByLink(link string) *dataobject.ChannelsDO

select id, creator_user_id, access_hash, random_id, top_message, participant_count, title, about, photo_id, link, broadcast, megagroup, democracy, signatures, admins_enabled, deactivated, version, `date` from channels where link = :link TODO(@benqi): sqlmap

func (*ChannelsDAO) UpdateAbout

func (dao *ChannelsDAO) UpdateAbout(about string, date int32, id int32) int64

update channels set about = :about, `date` = :date, version = version + 1 where id = :id TODO(@benqi): sqlmap

func (*ChannelsDAO) UpdateAdminsEnabled

func (dao *ChannelsDAO) UpdateAdminsEnabled(admins_enabled int8, date int32, id int32) int64

update channels set admins_enabled = :admins_enabled, `date` = :date, version = version + 1 where id = :id TODO(@benqi): sqlmap

func (*ChannelsDAO) UpdateDemocracy

func (dao *ChannelsDAO) UpdateDemocracy(democracy int8, date int32, id int32) int64

update channels set democracy = :democracy, `date` = :date, version = version + 1 where id = :id TODO(@benqi): sqlmap

func (dao *ChannelsDAO) UpdateLink(link string, date int32, id int32) int64

update channels set link = :link, `date` = :date, version = version + 1 where id = :id TODO(@benqi): sqlmap

func (*ChannelsDAO) UpdateParticipantCount

func (dao *ChannelsDAO) UpdateParticipantCount(participant_count int32, date int32, id int32) int64

update channels set participant_count = :participant_count, `date` = :date, version = version + 1 where id = :id TODO(@benqi): sqlmap

func (*ChannelsDAO) UpdatePhotoId

func (dao *ChannelsDAO) UpdatePhotoId(photo_id int64, date int32, id int32) int64

update channels set photo_id = :photo_id, `date` = :date, version = version + 1 where id = :id TODO(@benqi): sqlmap

func (*ChannelsDAO) UpdateSignatures

func (dao *ChannelsDAO) UpdateSignatures(signatures int8, date int32, id int32) int64

update channels set signatures = :signatures, `date` = :date, version = version + 1 where id = :id TODO(@benqi): sqlmap

func (*ChannelsDAO) UpdateTitle

func (dao *ChannelsDAO) UpdateTitle(title string, date int32, id int32) int64

update channels set title = :title, `date` = :date, version = version + 1 where id = :id TODO(@benqi): sqlmap

func (*ChannelsDAO) UpdateTopMessage

func (dao *ChannelsDAO) UpdateTopMessage(top_message int32, id int32) int64

update channels set top_message = :top_message where id = :id TODO(@benqi): sqlmap

func (*ChannelsDAO) UpdateVersion

func (dao *ChannelsDAO) UpdateVersion(date int32, id int32) int64

update channels set `date` = :date, version = version + 1 where id = :id TODO(@benqi): sqlmap

type ChatParticipantsDAO

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

func NewChatParticipantsDAO

func NewChatParticipantsDAO(db *sqlx.DB) *ChatParticipantsDAO

func (*ChatParticipantsDAO) DeleteChatUser

func (dao *ChatParticipantsDAO) DeleteChatUser(id int32) int64

update chat_participants set state = 1 where id = :id TODO(@benqi): sqlmap

func (*ChatParticipantsDAO) Insert

insert into chat_participants(chat_id, user_id, participant_type, inviter_user_id, invited_at, joined_at, state) values (:chat_id, :user_id, :participant_type, :inviter_user_id, :invited_at, :joined_at, :state) TODO(@benqi): sqlmap

func (*ChatParticipantsDAO) SelectByChatId

func (dao *ChatParticipantsDAO) SelectByChatId(chat_id int32) []dataobject.ChatParticipantsDO

select id, chat_id, user_id, participant_type, inviter_user_id, invited_at, joined_at, state from chat_participants where chat_id = :chat_id TODO(@benqi): sqlmap

func (*ChatParticipantsDAO) Update

func (dao *ChatParticipantsDAO) Update(inviter_user_id int32, invited_at int32, joined_at int32, id int32) int64

update chat_participants set inviter_user_id = :inviter_user_id, invited_at = :invited_at, joined_at = :joined_at, state = 0 where id = :id TODO(@benqi): sqlmap

func (*ChatParticipantsDAO) UpdateParticipantType

func (dao *ChatParticipantsDAO) UpdateParticipantType(participant_type int8, id int32) int64

update chat_participants set participant_type = :participant_type where id = :id TODO(@benqi): sqlmap

type ChatsDAO

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

func NewChatsDAO

func NewChatsDAO(db *sqlx.DB) *ChatsDAO

func (*ChatsDAO) Insert

func (dao *ChatsDAO) Insert(do *dataobject.ChatsDO) int64

insert into chats(creator_user_id, access_hash, random_id, participant_count, title, `date`) values (:creator_user_id, :access_hash, :random_id, :participant_count, :title, :date) TODO(@benqi): sqlmap

func (*ChatsDAO) Select

func (dao *ChatsDAO) Select(id int32) *dataobject.ChatsDO

select id, creator_user_id, access_hash, participant_count, title, photo_id, admins_enabled, deactivated, version, `date` from chats where id = :id TODO(@benqi): sqlmap

func (*ChatsDAO) SelectByIdList

func (dao *ChatsDAO) SelectByIdList(idList []int32) []dataobject.ChatsDO

select id, access_hash, participant_count, title, photo_id, admins_enabled, deactivated, version, `date` from chats where id in (:idList) TODO(@benqi): sqlmap

func (*ChatsDAO) UpdateAdminsEnabled

func (dao *ChatsDAO) UpdateAdminsEnabled(admins_enabled int8, date int32, id int32) int64

update chats set admins_enabled = :admins_enabled, `date` = :date, version = version + 1 where id = :id TODO(@benqi): sqlmap

func (*ChatsDAO) UpdateParticipantCount

func (dao *ChatsDAO) UpdateParticipantCount(participant_count int32, date int32, id int32) int64

update chats set participant_count = :participant_count, `date` = :date, version = version + 1 where id = :id TODO(@benqi): sqlmap

func (*ChatsDAO) UpdatePhotoId

func (dao *ChatsDAO) UpdatePhotoId(photo_id int64, date int32, id int32) int64

update chats set photo_id = :photo_id, `date` = :date, version = version + 1 where id = :id TODO(@benqi): sqlmap

func (*ChatsDAO) UpdateTitle

func (dao *ChatsDAO) UpdateTitle(title string, date int32, id int32) int64

update chats set title = :title, `date` = :date, version = version + 1 where id = :id TODO(@benqi): sqlmap

func (*ChatsDAO) UpdateVersion

func (dao *ChatsDAO) UpdateVersion(date int32, id int32) int64

update chats set `date` = :date, version = version + 1 where id = :id TODO(@benqi): sqlmap

type CommonDAO

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

func NewCommonDAO

func NewCommonDAO(db *sqlx.DB) *CommonDAO

func (*CommonDAO) CheckExists

func (dao *CommonDAO) CheckExists(table string, params map[string]interface{}) bool

检查是否存在 TODO(@benqi): SELECT count(id) 是否会快一点?

type DevicesDAO

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

func NewDevicesDAO

func NewDevicesDAO(db *sqlx.DB) *DevicesDAO

func (*DevicesDAO) Insert

func (dao *DevicesDAO) Insert(do *dataobject.DevicesDO) int64

insert into devices(auth_key_id, user_id, token_type, token) values (:auth_key_id, :user_id, :token_type, :token) TODO(@benqi): sqlmap

func (*DevicesDAO) SelectByToken

func (dao *DevicesDAO) SelectByToken(token_type int8, token string) *dataobject.DevicesDO

select id, auth_key_id, user_id, token_type, token from devices where token_type = :token_type and token = :token TODO(@benqi): sqlmap

func (*DevicesDAO) SelectListById

func (dao *DevicesDAO) SelectListById(token_type int8, token string) []dataobject.DevicesDO

select id, auth_key_id, user_id, token_type, token from devices where token_type = :token_type and token = :token and state = 1 TODO(@benqi): sqlmap

func (*DevicesDAO) UpdateStateById

func (dao *DevicesDAO) UpdateStateById(state int8, id int64) int64

update devices set state = :state where id = :id TODO(@benqi): sqlmap

func (*DevicesDAO) UpdateStateByToken

func (dao *DevicesDAO) UpdateStateByToken(state int8, token_type int8, token string) int64

update devices set state = :state where token_type = :token_type and token = :token TODO(@benqi): sqlmap

type ImportedContactsDAO

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

func NewImportedContactsDAO

func NewImportedContactsDAO(db *sqlx.DB) *ImportedContactsDAO

func (*ImportedContactsDAO) Insert

insert into imported_contacts(user_id, imported_user_id) values (:user_id, :imported_user_id) TODO(@benqi): sqlmap

func (*ImportedContactsDAO) SelectImportedContacts

func (dao *ImportedContactsDAO) SelectImportedContacts(user_id int32) []dataobject.ImportedContactsDO

select id, user_id, imported_user_id from imported_contacts where user_id = :user_id TODO(@benqi): sqlmap

type MessageBoxesDAO

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

func NewMessageBoxesDAO

func NewMessageBoxesDAO(db *sqlx.DB) *MessageBoxesDAO

func (*MessageBoxesDAO) DeleteMessagesByMessageIdList

func (dao *MessageBoxesDAO) DeleteMessagesByMessageIdList(user_id int32, idList []int32) int64

update message_boxes set deleted = 1 where user_id = :user_id and user_message_box_id in (:idList) and deleted = 0 TODO(@benqi): sqlmap

func (*MessageBoxesDAO) Insert

insert ignore into message_boxes(user_id, user_message_box_id, dialog_id, dialog_message_id, message_data_id, message_box_type, reply_to_msg_id, media_unread, date2) values (:user_id, :user_message_box_id, :dialog_id, :dialog_message_id, :message_data_id, :message_box_type, :reply_to_msg_id, :media_unread, :date2) TODO(@benqi): sqlmap

func (*MessageBoxesDAO) SelectBackwardByOffsetLimit

func (dao *MessageBoxesDAO) SelectBackwardByOffsetLimit(user_id int32, dialog_id int64, user_message_box_id int32, limit int32) []dataobject.MessageBoxesDO

select user_id, user_message_box_id, dialog_id, dialog_message_id, message_data_id, message_box_type, reply_to_msg_id, media_unread, date2 from message_boxes where user_id = :user_id and dialog_id = :dialog_id and user_message_box_id < :user_message_box_id and deleted = 0 order by user_message_box_id desc limit :limit TODO(@benqi): sqlmap

func (*MessageBoxesDAO) SelectByMessageDataId

func (dao *MessageBoxesDAO) SelectByMessageDataId(message_data_id int64) *dataobject.MessageBoxesDO

select user_id, user_message_box_id, dialog_id, dialog_message_id, message_data_id, message_box_type, reply_to_msg_id, media_unread, date2 from message_boxes where message_data_id = :message_data_id and deleted = 0 limit 1 TODO(@benqi): sqlmap

func (*MessageBoxesDAO) SelectByMessageDataIdList

func (dao *MessageBoxesDAO) SelectByMessageDataIdList(idList []int64) []dataobject.MessageBoxesDO

select user_id, user_message_box_id, dialog_id, dialog_message_id, message_data_id, message_box_type, reply_to_msg_id, media_unread, date2 from message_boxes where deleted = 0 and message_data_id in (:idList) order by user_message_box_id desc TODO(@benqi): sqlmap

func (*MessageBoxesDAO) SelectByMessageId

func (dao *MessageBoxesDAO) SelectByMessageId(user_id int32, user_message_box_id int32) *dataobject.MessageBoxesDO

select user_id, user_message_box_id, dialog_id, dialog_message_id, message_data_id, message_box_type, reply_to_msg_id, media_unread, date2 from message_boxes where user_id = :user_id and user_message_box_id = :user_message_box_id and deleted = 0 limit 1 TODO(@benqi): sqlmap

func (*MessageBoxesDAO) SelectByMessageIdList

func (dao *MessageBoxesDAO) SelectByMessageIdList(user_id int32, idList []int32) []dataobject.MessageBoxesDO

select user_id, user_message_box_id, dialog_id, dialog_message_id, message_data_id, message_box_type, reply_to_msg_id, media_unread, date2 from message_boxes where user_id = :user_id and deleted = 0 and user_message_box_id in (:idList) order by user_message_box_id desc TODO(@benqi): sqlmap

func (*MessageBoxesDAO) SelectDialogMessageIdList

func (dao *MessageBoxesDAO) SelectDialogMessageIdList(user_id int32, dialog_id int64) []dataobject.MessageBoxesDO

select user_message_box_id, date2 from message_boxes where user_id = :user_id and dialog_id = :dialog_id and deleted = 0 order by user_message_box_id desc TODO(@benqi): sqlmap

func (*MessageBoxesDAO) SelectDialogMessageListByMessageId

func (dao *MessageBoxesDAO) SelectDialogMessageListByMessageId(user_id int32, user_message_box_id int32) []dataobject.MessageBoxesDO

select user_id, user_message_box_id, dialog_id, dialog_message_id, message_data_id, message_box_type, reply_to_msg_id, media_unread, date2 from message_boxes where dialog_message_id = (select dialog_message_id from message_boxes where user_id = :user_id and user_message_box_id = :user_message_box_id) and deleted = 0 TODO(@benqi): sqlmap

func (*MessageBoxesDAO) SelectDialogsByMessageIdList

func (dao *MessageBoxesDAO) SelectDialogsByMessageIdList(user_id int32, idList []int32) []dataobject.MessageBoxesDO

select user_id, user_message_box_id, dialog_id, dialog_message_id, message_data_id, message_box_type, reply_to_msg_id, media_unread, date2 from message_boxes where user_id = :user_id and user_message_box_id in (:idList) and deleted = 0 TODO(@benqi): sqlmap

func (*MessageBoxesDAO) SelectForwardByPeerOffsetLimit

func (dao *MessageBoxesDAO) SelectForwardByPeerOffsetLimit(user_id int32, dialog_id int64, user_message_box_id int32, limit int32) []dataobject.MessageBoxesDO

select user_id, user_message_box_id, dialog_id, dialog_message_id, message_data_id, message_box_type, reply_to_msg_id, media_unread, date2 from message_boxes where user_id = :user_id and dialog_id = :dialog_id and user_message_box_id >= :user_message_box_id and deleted = 0 order by user_message_box_id asc limit :limit TODO(@benqi): sqlmap

func (*MessageBoxesDAO) SelectLastTwoMessageId

func (dao *MessageBoxesDAO) SelectLastTwoMessageId(user_id int32) *dataobject.MessageBoxesDO

select user_message_box_id from message_boxes where user_id = :user_id and deleted = 0 order by user_message_box_id desc limit 2 TODO(@benqi): sqlmap

func (*MessageBoxesDAO) SelectPeerDialogMessageIdList

func (dao *MessageBoxesDAO) SelectPeerDialogMessageIdList(user_id int32, idList []int32) []dataobject.MessageBoxesDO

select user_id, user_message_box_id, dialog_id, dialog_message_id, message_data_id, message_box_type, reply_to_msg_id, media_unread, date2 from message_boxes where user_id != :user_id and dialog_message_id in (select dialog_message_id from message_boxes where user_id = :user_id and user_message_box_id in (:idList)) and deleted = 0 TODO(@benqi): sqlmap

func (*MessageBoxesDAO) SelectPeerDialogMessageListByMessageId

func (dao *MessageBoxesDAO) SelectPeerDialogMessageListByMessageId(user_id int32, user_message_box_id int32) []dataobject.MessageBoxesDO

select user_id, user_message_box_id, dialog_id, dialog_message_id, message_data_id, message_box_type, reply_to_msg_id, media_unread, date2 from message_boxes where user_id != :user_id and dialog_message_id = (select dialog_message_id from messages where user_id = :user_id and user_message_box_id = :user_message_box_id) and deleted = 0 TODO(@benqi): sqlmap

func (*MessageBoxesDAO) SelectPeerMessageId

func (dao *MessageBoxesDAO) SelectPeerMessageId(peerId int32, user_id int32, user_message_box_id int32) *dataobject.MessageBoxesDO

select user_message_box_id, message_box_type from message_boxes where user_id = :peerId and deleted = 0 and dialog_message_id = (select dialog_message_id from message_boxes where user_id = :user_id and user_message_box_id = :user_message_box_id and deleted = 0 limit 1) TODO(@benqi): sqlmap

func (*MessageBoxesDAO) SelectPeerMessageList

func (dao *MessageBoxesDAO) SelectPeerMessageList(user_id int32, message_data_id int64) []dataobject.MessageBoxesDO

select user_id, user_message_box_id, dialog_id, dialog_message_id, message_data_id, message_box_type, reply_to_msg_id, media_unread, date2 from message_boxes where user_id != :user_id and message_data_id = :message_data_id and deleted = 0 TODO(@benqi): sqlmap

type MessageDatasDAO

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

func NewMessageDatasDAO

func NewMessageDatasDAO(db *sqlx.DB) *MessageDatasDAO

func (*MessageDatasDAO) Insert

insert ignore into message_datas(message_data_id, dialog_id, dialog_message_id, sender_user_id, peer_type, peer_id, random_id, message_type, message_data, has_media_unread, `date`, edit_message, edit_date, views) values (:message_data_id, :dialog_id, :dialog_message_id, :sender_user_id, :peer_type, :peer_id, :random_id, :message_type, :message_data, :has_media_unread, :date, :edit_message, :edit_date, :views) TODO(@benqi): sqlmap

func (*MessageDatasDAO) SelectMessage

func (dao *MessageDatasDAO) SelectMessage(dialog_id int64, dialog_message_id int32) *dataobject.MessageDatasDO

select message_data_id, dialog_id, dialog_message_id, sender_user_id, peer_type, peer_id, random_id, message_type, message_data, has_media_unread, `date`, edit_message, edit_date, views from message_datas where dialog_id = :dialog_id and dialog_message_id = :dialog_message_id limit 1 TODO(@benqi): sqlmap

func (*MessageDatasDAO) SelectMessageByDataId

func (dao *MessageDatasDAO) SelectMessageByDataId(message_data_id int64) *dataobject.MessageDatasDO

select message_data_id, dialog_id, dialog_message_id, sender_user_id, peer_type, peer_id, random_id, message_type, message_data, has_media_unread, `date`, edit_message, edit_date, views from message_datas where message_data_id = :message_data_id TODO(@benqi): sqlmap

func (*MessageDatasDAO) SelectMessageByRandomId

func (dao *MessageDatasDAO) SelectMessageByRandomId(sender_user_id int32, random_id int64) *dataobject.MessageDatasDO

select message_data_id, dialog_id, dialog_message_id, sender_user_id, peer_type, peer_id, random_id, message_type, message_data, has_media_unread, `date`, edit_message, edit_date, views from message_datas where sender_user_id = :sender_user_id and random_id = :random_id limit 1 TODO(@benqi): sqlmap

func (*MessageDatasDAO) SelectMessageList

func (dao *MessageDatasDAO) SelectMessageList(dialog_id int64, idList []int32) []dataobject.MessageDatasDO

select message_data_id, dialog_id, dialog_message_id, sender_user_id, peer_type, peer_id, random_id, message_type, message_data, has_media_unread, `date`, edit_message, edit_date, views from message_datas where dialog_id = :dialog_id and dialog_message_id in (:idList) TODO(@benqi): sqlmap

func (*MessageDatasDAO) SelectMessageListByDataIdList

func (dao *MessageDatasDAO) SelectMessageListByDataIdList(idList []int64) []dataobject.MessageDatasDO

select message_data_id, dialog_id, dialog_message_id, sender_user_id, peer_type, peer_id, random_id, message_type, message_data, has_media_unread, `date`, edit_message, edit_date, views from message_datas where message_data_id in (:idList) TODO(@benqi): sqlmap

func (*MessageDatasDAO) UpdateEditMessage

func (dao *MessageDatasDAO) UpdateEditMessage(edit_message string, edit_date int32, dialog_id int64, dialog_message_id int32) int64

update message_datas set edit_message = :edit_message, edit_date = :edit_date where dialog_id = :dialog_id and dialog_message_id = :dialog_message_id TODO(@benqi): sqlmap

func (*MessageDatasDAO) UpdateViews

func (dao *MessageDatasDAO) UpdateViews(views int32, dialog_id int64, dialog_message_id int32) int64

update message_datas set views = :views where dialog_id = :dialog_id and dialog_message_id = :dialog_message_id TODO(@benqi): sqlmap

type MessagesDAO

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

func NewMessagesDAO

func NewMessagesDAO(db *sqlx.DB) *MessagesDAO

func (*MessagesDAO) DeleteMessagesByMessageIdList

func (dao *MessagesDAO) DeleteMessagesByMessageIdList(user_id int32, idList []int32) int64

update message_boxes set deleted = 1 where user_id = :user_id and user_message_box_id in (:idList) and deleted = 0 TODO(@benqi): sqlmap

func (*MessagesDAO) Insert

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

insert into message_boxes(user_id, user_message_box_id, dialog_message_id, sender_user_id, message_box_type, peer_type, peer_id, random_id, message_type, message_data, date2) values (:user_id, :user_message_box_id, :dialog_message_id, :sender_user_id, :message_box_type, :peer_type, :peer_id, :random_id, :message_type, :message_data, :date2) TODO(@benqi): sqlmap

func (*MessagesDAO) SelectBackwardByPeerOffsetLimit

func (dao *MessagesDAO) SelectBackwardByPeerOffsetLimit(user_id int32, peer_type int8, peer_id int32, user_message_box_id int32, limit int32) []dataobject.MessagesDO

select user_id, user_message_box_id, sender_user_id, message_box_type, peer_type, peer_id, message_type, message_data, date2 from message_boxes where user_id = :user_id and peer_type = :peer_type and peer_id = :peer_id and user_message_box_id < :user_message_box_id and deleted = 0 order by user_message_box_id desc limit :limit TODO(@benqi): sqlmap

func (*MessagesDAO) SelectBackwardByPeerUserOffsetLimit

func (dao *MessagesDAO) SelectBackwardByPeerUserOffsetLimit(user_id int32, peer_id int32, peer_type int8, user_message_box_id int32, limit int32) []dataobject.MessagesDO

select user_id, user_message_box_id, sender_user_id, message_box_type, peer_type, peer_id, message_type, message_data, date2 from message_boxes where user_id = :user_id and ((sender_user_id = :user_id and peer_id = :peer_id) or (sender_user_id = :peer_id and peer_id = :user_id)) and peer_type = :peer_type and user_message_box_id < :user_message_box_id and deleted = 0 order by user_message_box_id desc limit :limit TODO(@benqi): sqlmap

func (*MessagesDAO) SelectByMessageId

func (dao *MessagesDAO) SelectByMessageId(user_id int32, user_message_box_id int32) *dataobject.MessagesDO

select user_id, user_message_box_id, dialog_message_id, sender_user_id, message_box_type, peer_type, peer_id, message_type, message_data, date2 from message_boxes where user_id = :user_id and user_message_box_id = :user_message_box_id and deleted = 0 limit 1 TODO(@benqi): sqlmap

func (*MessagesDAO) SelectByMessageIdList

func (dao *MessagesDAO) SelectByMessageIdList(user_id int32, idList []int32) []dataobject.MessagesDO

select user_id, user_message_box_id, dialog_message_id, sender_user_id, message_box_type, peer_type, peer_id, message_type, message_data, date2 from message_boxes where user_id = :user_id and deleted = 0 and user_message_box_id in (:idList) order by user_message_box_id desc TODO(@benqi): sqlmap

func (*MessagesDAO) SelectDialogMessageIdList

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

select user_message_box_id from message_boxes where user_id = :user_id and ((sender_user_id = :user_id and peer_id = :peer_id) or (sender_user_id = :peer_id and peer_id = :user_id)) and peer_type = :peer_type and deleted = 0 TODO(@benqi): sqlmap

func (*MessagesDAO) SelectDialogMessageListByMessageId

func (dao *MessagesDAO) SelectDialogMessageListByMessageId(user_id int32, user_message_box_id int32) []dataobject.MessagesDO

select user_id, user_message_box_id, dialog_message_id, sender_user_id, message_box_type, peer_type, peer_id, message_type, message_data, date2 from message_boxes where dialog_message_id = (select dialog_message_id from messages where user_id = :user_id and user_message_box_id = :user_message_box_id) and deleted = 0 TODO(@benqi): sqlmap

func (*MessagesDAO) SelectDialogsByMessageIdList

func (dao *MessagesDAO) SelectDialogsByMessageIdList(user_id int32, idList []int32) []dataobject.MessagesDO

select user_id, user_message_box_id, sender_user_id, message_box_type, peer_type, peer_id, dialog_message_id, message_type from message_boxes where user_id = :user_id and user_message_box_id in (:idList) and deleted = 0 TODO(@benqi): sqlmap

func (*MessagesDAO) SelectForwardByPeerOffsetLimit

func (dao *MessagesDAO) SelectForwardByPeerOffsetLimit(user_id int32, peer_type int8, peer_id int32, user_message_box_id int32, limit int32) []dataobject.MessagesDO

select user_id, user_message_box_id, sender_user_id, message_box_type, peer_type, peer_id, message_type, message_data, date2 from message_boxes where user_id = :user_id and peer_type = :peer_type and peer_id = :peer_id and user_message_box_id >= :user_message_box_id and deleted = 0 order by user_message_box_id asc limit :limit TODO(@benqi): sqlmap

func (*MessagesDAO) SelectForwardByPeerUserOffsetLimit

func (dao *MessagesDAO) SelectForwardByPeerUserOffsetLimit(user_id int32, peer_id int32, peer_type int8, user_message_box_id int32, limit int32) []dataobject.MessagesDO

select user_id, user_message_box_id, sender_user_id, message_box_type, peer_type, peer_id, message_type, message_data, date2 from message_boxes where user_id = :user_id and ((sender_user_id = :user_id and peer_id = :peer_id) or (sender_user_id = :peer_id and peer_id = :user_id)) and peer_type = :peer_type and user_message_box_id >= :user_message_box_id and deleted = 0 order by user_message_box_id asc limit :limit TODO(@benqi): sqlmap

func (*MessagesDAO) SelectLastTwoMessageId

func (dao *MessagesDAO) SelectLastTwoMessageId(user_id int32) *dataobject.MessagesDO

select user_message_box_id from message_boxes where user_id = :user_id order by user_message_box_id desc limit 2 TODO(@benqi): sqlmap

func (*MessagesDAO) SelectPeerDialogMessageIdList

func (dao *MessagesDAO) SelectPeerDialogMessageIdList(user_id int32, idList []int32) []dataobject.MessagesDO

select user_id, user_message_box_id, sender_user_id, message_box_type, peer_type, peer_id, dialog_message_id, message_type from message_boxes where user_id != :user_id and dialog_message_id in (select dialog_message_id from messages where user_id = :user_id and user_message_box_id in (:idList)) and deleted = 0 TODO(@benqi): sqlmap

func (*MessagesDAO) SelectPeerDialogMessageListByMessageId

func (dao *MessagesDAO) SelectPeerDialogMessageListByMessageId(user_id int32, user_message_box_id int32) []dataobject.MessagesDO

select user_id, user_message_box_id, dialog_message_id, sender_user_id, message_box_type, peer_type, peer_id, message_type, message_data, date2 from message_boxes where user_id != :user_id and dialog_message_id = (select dialog_message_id from messages where user_id = :user_id and user_message_box_id = :user_message_box_id) and deleted = 0 TODO(@benqi): sqlmap

func (*MessagesDAO) SelectPeerMessageId

func (dao *MessagesDAO) SelectPeerMessageId(peerId int32, user_id int32, user_message_box_id int32) *dataobject.MessagesDO

select user_message_box_id, message_box_type from message_boxes where user_id = :peerId and dialog_message_id = (select dialog_message_id from messages where user_id = :user_id and user_message_box_id = :user_message_box_id and deleted = 0 limit 1) TODO(@benqi): sqlmap

func (*MessagesDAO) UpdateMessagesData

func (dao *MessagesDAO) UpdateMessagesData(message_data string, user_id int32, user_message_box_id int32) int64

update message_boxes set message_data = :message_data where user_id = :user_id and user_message_box_id = :user_message_box_id and deleted = 0 TODO(@benqi): sqlmap

type PhoneCallSessionsDAO

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

func NewPhoneCallSessionsDAO

func NewPhoneCallSessionsDAO(db *sqlx.DB) *PhoneCallSessionsDAO

func (*PhoneCallSessionsDAO) Insert

insert into phone_call_sessions(call_session_id, admin_id, admin_access_hash, participant_id, participant_access_hash, udp_p2p, udp_reflector, min_layer, max_layer, g_a, admin_debug_data, participant_debug_data, `date`) values (:call_session_id, :admin_id, :admin_access_hash, :participant_id, :participant_access_hash, :udp_p2p, :udp_reflector, :min_layer, :max_layer, :g_a, :admin_debug_data, :participant_debug_data, :date) TODO(@benqi): sqlmap

func (*PhoneCallSessionsDAO) Select

func (dao *PhoneCallSessionsDAO) Select(call_session_id int64) *dataobject.PhoneCallSessionsDO

select id, call_session_id, admin_id, admin_access_hash, participant_id, participant_access_hash, udp_p2p, udp_reflector, min_layer, max_layer, g_a, g_b, `date` from phone_call_sessions where call_session_id = :call_session_id TODO(@benqi): sqlmap

func (*PhoneCallSessionsDAO) UpdateAdminDebugData

func (dao *PhoneCallSessionsDAO) UpdateAdminDebugData(admin_debug_data string, call_session_id int64) int64

update phone_call_sessions set admin_debug_data = :admin_debug_data where call_session_id = :call_session_id TODO(@benqi): sqlmap

func (*PhoneCallSessionsDAO) UpdateGB

func (dao *PhoneCallSessionsDAO) UpdateGB(g_b string, call_session_id int64) int64

update phone_call_sessions set g_b = :g_b where call_session_id = :call_session_id TODO(@benqi): sqlmap

func (*PhoneCallSessionsDAO) UpdateParticipantDebugData

func (dao *PhoneCallSessionsDAO) UpdateParticipantDebugData(participant_debug_data string, call_session_id int64) int64

update phone_call_sessions set participant_debug_data = :participant_debug_data where call_session_id = :call_session_id TODO(@benqi): sqlmap

type PopularContactsDAO

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

func NewPopularContactsDAO

func NewPopularContactsDAO(db *sqlx.DB) *PopularContactsDAO

func (*PopularContactsDAO) IncreaseImporters

func (dao *PopularContactsDAO) IncreaseImporters(phone string) int64

update popular_contacts set importers = importers + 1 where phone = :phone TODO(@benqi): sqlmap

func (*PopularContactsDAO) IncreaseImportersList

func (dao *PopularContactsDAO) IncreaseImportersList(phoneList []string) int64

update popular_contacts set importers = importers + 1 where phone in (:phoneList) TODO(@benqi): sqlmap

func (*PopularContactsDAO) Insert

insert into popular_contacts(phone, importers) values (:phone, :importers) TODO(@benqi): sqlmap

func (*PopularContactsDAO) SelectImporters

func (dao *PopularContactsDAO) SelectImporters(phone string) *dataobject.PopularContactsDO

select phone, importers from popular_contacts where phone = :phone TODO(@benqi): sqlmap

func (*PopularContactsDAO) SelectImportersList

func (dao *PopularContactsDAO) SelectImportersList(phoneList []string) []dataobject.PopularContactsDO

select phone, importers from popular_contacts where phone in (:phoneList) TODO(@benqi): sqlmap

type ReportsDAO

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

func NewReportsDAO

func NewReportsDAO(db *sqlx.DB) *ReportsDAO

func (*ReportsDAO) Insert

func (dao *ReportsDAO) Insert(do *dataobject.ReportsDO) int64

insert into reports(user_id, peer_type, peer_id, reason, content) values (:user_id, :peer_type, :peer_id, :reason, :content) TODO(@benqi): sqlmap

type StickerPacksDAO

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

func NewStickerPacksDAO

func NewStickerPacksDAO(db *sqlx.DB) *StickerPacksDAO

func (*StickerPacksDAO) Insert

insert into sticker_packs(sticker_set_id, emoticon, document_id) values (:sticker_set_id, :emoticon, :document_id) TODO(@benqi): sqlmap

func (*StickerPacksDAO) SelectBySetID

func (dao *StickerPacksDAO) SelectBySetID(sticker_set_id int64) []dataobject.StickerPacksDO

select sticker_set_id, emoticon, document_id from sticker_packs where sticker_set_id = :sticker_set_id TODO(@benqi): sqlmap

type StickerSetsDAO

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

func NewStickerSetsDAO

func NewStickerSetsDAO(db *sqlx.DB) *StickerSetsDAO

func (*StickerSetsDAO) Insert

func (dao *StickerSetsDAO) Insert(do *dataobject.StickerSetsDO) int64

insert into sticker_sets(sticker_set_id, access_hash) values (:sticker_set_id, :access_hash) TODO(@benqi): sqlmap

func (*StickerSetsDAO) SelectAll

func (dao *StickerSetsDAO) SelectAll() []dataobject.StickerSetsDO

select sticker_set_id, access_hash, title, short_name, count, hash from sticker_sets where hash > 0 TODO(@benqi): sqlmap

func (*StickerSetsDAO) SelectByID

func (dao *StickerSetsDAO) SelectByID(sticker_set_id int64, access_hash int64) *dataobject.StickerSetsDO

select sticker_set_id, access_hash, title, short_name, count, hash from sticker_sets where sticker_set_id = :sticker_set_id and access_hash = :access_hash TODO(@benqi): sqlmap

func (*StickerSetsDAO) SelectByShortName

func (dao *StickerSetsDAO) SelectByShortName(short_name string) *dataobject.StickerSetsDO

select sticker_set_id, access_hash, title, short_name, count, hash from sticker_sets where short_name = :short_name TODO(@benqi): sqlmap

type TmpPasswordsDAO

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

func NewTmpPasswordsDAO

func NewTmpPasswordsDAO(db *sqlx.DB) *TmpPasswordsDAO

func (*TmpPasswordsDAO) Insert

insert into devices(auth_id, user_id, password_hash, period, tmp_password, valid_until) values (:auth_id, :user_id, :password_hash, :period, :tmp_password, :valid_until) TODO(@benqi): sqlmap

type UnregisteredContactsDAO

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

func NewUnregisteredContactsDAO

func NewUnregisteredContactsDAO(db *sqlx.DB) *UnregisteredContactsDAO

func (*UnregisteredContactsDAO) DeleteContacts

func (dao *UnregisteredContactsDAO) DeleteContacts(id_list []int64) int64

update unregistered_contacts set is_deleted = 1 where id in (:id_list) TODO(@benqi): sqlmap

func (*UnregisteredContactsDAO) Insert

insert into unregistered_contacts(importer_user_id, contact_phone, contact_first_name, contact_last_name) values (:importer_user_id, :contact_phone, :contact_first_name, :contact_last_name) TODO(@benqi): sqlmap

func (*UnregisteredContactsDAO) SelectContacts

func (dao *UnregisteredContactsDAO) SelectContacts(importer_user_id int32, phone_list []string) []dataobject.UnregisteredContactsDO

select id, importer_user_id, contact_phone, contact_first_name, contact_last_name from unregistered_contacts where importer_user_id = :importer_user_id and is_deleted = 0 and contact_phone in (:phone_list) TODO(@benqi): sqlmap

func (*UnregisteredContactsDAO) UpdateContactName

func (dao *UnregisteredContactsDAO) UpdateContactName(contact_first_name string, contact_last_name string, id int32) int64

update unregistered_contacts set contact_first_name = :contact_first_name, contact_last_name = :contact_last_name where id = :id TODO(@benqi): sqlmap

type UserContactsDAO

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

func NewUserContactsDAO

func NewUserContactsDAO(db *sqlx.DB) *UserContactsDAO

func (*UserContactsDAO) DeleteContacts

func (dao *UserContactsDAO) DeleteContacts(owner_user_id int32, id_list []int32) int64

update user_contacts set is_deleted = 1, mutual = 0 where contact_user_id != 0 and (owner_user_id = :owner_user_id and contact_user_id in (:id_list)) TODO(@benqi): sqlmap

func (*UserContactsDAO) Insert

insert into user_contacts(owner_user_id, contact_user_id, contact_phone, contact_first_name, contact_last_name, mutual, date2) values (:owner_user_id, :contact_user_id, :contact_phone, :contact_first_name, :contact_last_name, :mutual, :date2) TODO(@benqi): sqlmap

func (*UserContactsDAO) SelectAllUserContacts

func (dao *UserContactsDAO) SelectAllUserContacts(owner_user_id int32) []dataobject.UserContactsDO

select id, owner_user_id, contact_user_id, contact_phone, contact_first_name, contact_last_name, mutual, is_deleted from user_contacts where owner_user_id = :owner_user_id TODO(@benqi): sqlmap

func (*UserContactsDAO) SelectBlockedList

func (dao *UserContactsDAO) SelectBlockedList(owner_user_id int32, limit int32) []dataobject.UserContactsDO

select contact_user_id from user_contacts where owner_user_id = :owner_user_id and is_blocked = 1 and is_deleted = 0 order by id asc limit :limit TODO(@benqi): sqlmap

func (*UserContactsDAO) SelectUserContact

func (dao *UserContactsDAO) SelectUserContact(owner_user_id int32, contact_user_id int32) *dataobject.UserContactsDO

select id, owner_user_id, contact_user_id, contact_phone, contact_first_name, contact_last_name, mutual, is_deleted from user_contacts where owner_user_id = :owner_user_id and contact_user_id = :contact_user_id TODO(@benqi): sqlmap

func (*UserContactsDAO) SelectUserContacts

func (dao *UserContactsDAO) SelectUserContacts(owner_user_id int32) []dataobject.UserContactsDO

select id, owner_user_id, contact_user_id, contact_phone, contact_first_name, contact_last_name, mutual, is_deleted from user_contacts where owner_user_id = :owner_user_id and is_deleted = 0 order by contact_user_id asc TODO(@benqi): sqlmap

func (*UserContactsDAO) UpdateBlock

func (dao *UserContactsDAO) UpdateBlock(is_blocked int8, owner_user_id int32, contact_user_id int32) int64

update user_contacts set is_blocked = :is_blocked where contact_user_id != 0 and (owner_user_id = :owner_user_id and contact_user_id = :contact_user_id) TODO(@benqi): sqlmap

func (*UserContactsDAO) UpdateContactNameById

func (dao *UserContactsDAO) UpdateContactNameById(contact_first_name string, contact_last_name string, id int64) int64

update user_contacts set contact_first_name = :contact_first_name, contact_last_name = :contact_last_name, is_deleted = 0 where id = :id TODO(@benqi): sqlmap

func (*UserContactsDAO) UpdateContactUserId

func (dao *UserContactsDAO) UpdateContactUserId(contact_user_id int32, mutual int8, owner_user_id int32, contact_phone string) int64

update user_contacts set contact_user_id = :contact_user_id, mutual = :mutual where contact_user_id = 0 and owner_user_id = :owner_user_id and contact_phone = :contact_phone TODO(@benqi): sqlmap

func (*UserContactsDAO) UpdateMutual

func (dao *UserContactsDAO) UpdateMutual(mutual int8, owner_user_id int32, contact_user_id int32) int64

update user_contacts set mutual = :mutual where contact_user_id != 0 and (owner_user_id = :owner_user_id and contact_user_id = :contact_user_id) TODO(@benqi): sqlmap

type UserDialogsDAO

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

func NewUserDialogsDAO

func NewUserDialogsDAO(db *sqlx.DB) *UserDialogsDAO

func (*UserDialogsDAO) CheckExists

func (dao *UserDialogsDAO) CheckExists(user_id int32, peer_type int8, peer_id int32) *dataobject.UserDialogsDO

select id from user_dialogs where user_id = :user_id and peer_type = :peer_type and peer_id = :peer_id TODO(@benqi): sqlmap

func (*UserDialogsDAO) ClearDraft

func (dao *UserDialogsDAO) ClearDraft(user_id int32, peer_type int8, peer_id int32) int64

update user_dialogs set draft_type = 0, draft_message_data = ” where user_id = :user_id and peer_type = :peer_type and peer_id = :peer_id TODO(@benqi): sqlmap

func (*UserDialogsDAO) Insert

func (dao *UserDialogsDAO) Insert(do *dataobject.UserDialogsDO) int64

insert ignore into user_dialogs(user_id, peer_type, peer_id, top_message, unread_count, unread_mentions_count, draft_message_data, date2, created_at) values (:user_id, :peer_type, :peer_id, :top_message, :unread_count, :unread_mentions_count, :draft_message_data, :date2, :created_at) TODO(@benqi): sqlmap

func (*UserDialogsDAO) InsertOrUpdate

func (dao *UserDialogsDAO) InsertOrUpdate(do *dataobject.UserDialogsDO) int64

insert into user_dialogs(user_id, peer_type, peer_id, top_message, unread_count, unread_mentions_count, draft_message_data, date2) values (:user_id, :peer_type, :peer_id, :top_message, :unread_count, :unread_mentions_count, ”, :date2) on duplicate key update top_message = values(top_message), unread_count = unread_count + values(unread_count), unread_mentions_count = unread_mentions_count + values(unread_mentions_count), date2 = values(date2) TODO(@benqi): sqlmap

func (*UserDialogsDAO) SaveDraft

func (dao *UserDialogsDAO) SaveDraft(draft_message_data string, user_id int32, peer_type int8, peer_id int32) int64

update user_dialogs set draft_type = 2, draft_message_data = :draft_message_data where user_id = :user_id and peer_type = :peer_type and peer_id = :peer_id TODO(@benqi): sqlmap

func (*UserDialogsDAO) SelectByPeer

func (dao *UserDialogsDAO) SelectByPeer(user_id int32, peer_type int8, peer_id int32) *dataobject.UserDialogsDO

select id, user_id, peer_type, peer_id, is_pinned, top_message, read_inbox_max_id, read_outbox_max_id, unread_count, unread_mentions_count, show_previews, silent, mute_until, sound, pts, draft_type, draft_message_data, date2 from user_dialogs where user_id = :user_id and peer_type = :peer_type and peer_id = :peer_id TODO(@benqi): sqlmap

func (*UserDialogsDAO) SelectByPinnedAndOffset

func (dao *UserDialogsDAO) SelectByPinnedAndOffset(user_id int32, is_pinned int8, top_message int32, limit int32) []dataobject.UserDialogsDO

select id, user_id, peer_type, peer_id, is_pinned, top_message, read_inbox_max_id, read_outbox_max_id, unread_count, unread_mentions_count, show_previews, silent, mute_until, sound, pts, draft_type, draft_message_data, date2 from user_dialogs where user_id = :user_id and is_pinned = :is_pinned and top_message < :top_message order by top_message desc limit :limit TODO(@benqi): sqlmap

func (*UserDialogsDAO) SelectDialogsByPeerType

func (dao *UserDialogsDAO) SelectDialogsByPeerType(user_id int32, peer_type int8) []dataobject.UserDialogsDO

select id, user_id, peer_type, peer_id, is_pinned, top_message, read_inbox_max_id, read_outbox_max_id, unread_count, unread_mentions_count, show_previews, silent, mute_until, sound, pts, draft_type, draft_message_data, date2 from user_dialogs where user_id = :user_id and peer_type = :peer_type TODO(@benqi): sqlmap

func (*UserDialogsDAO) SelectDialogsByPinnedAndOffsetDate

func (dao *UserDialogsDAO) SelectDialogsByPinnedAndOffsetDate(user_id int32, is_pinned int8, date2 int32, limit int32) []dataobject.UserDialogsDO

select id, user_id, peer_type, peer_id, is_pinned, top_message, read_inbox_max_id, read_outbox_max_id, unread_count, unread_mentions_count, show_previews, silent, mute_until, sound, pts, draft_type, draft_message_data, date2 from user_dialogs where user_id = :user_id and is_pinned = :is_pinned and date2 > :date2 order by date2 desc limit :limit TODO(@benqi): sqlmap

func (*UserDialogsDAO) SelectDialogsByUserID

func (dao *UserDialogsDAO) SelectDialogsByUserID(user_id int32) []dataobject.UserDialogsDO

select id, user_id, peer_type, peer_id, is_pinned, top_message, read_inbox_max_id, read_outbox_max_id, unread_count, unread_mentions_count, show_previews, silent, mute_until, sound, pts, draft_type, draft_message_data, date2 from user_dialogs where user_id = :user_id TODO(@benqi): sqlmap

func (*UserDialogsDAO) SelectPinnedDialogs

func (dao *UserDialogsDAO) SelectPinnedDialogs(user_id int32) []dataobject.UserDialogsDO

select id, user_id, peer_type, peer_id, is_pinned, top_message, read_inbox_max_id, read_outbox_max_id, unread_count, unread_mentions_count, show_previews, silent, mute_until, sound, pts, draft_type, draft_message_data, date2 from user_dialogs where user_id = :user_id and is_pinned = 1 order by top_message desc TODO(@benqi): sqlmap

func (*UserDialogsDAO) UpdateDialog

func (dao *UserDialogsDAO) UpdateDialog(top_message int32, user_id int32, peer_type int8, peer_id int32) int64

update user_dialogs set top_message = :top_message, unread_count = unread_count + unreadCount, unread_mentions_count = unread_mentions_count + unreadMentionCount where user_id = :user_id and peer_type = :peer_type and peer_id = :peer_id TODO(@benqi): sqlmap

func (*UserDialogsDAO) UpdatePinned

func (dao *UserDialogsDAO) UpdatePinned(is_pinned int8, user_id int32, peer_type int8, peer_id int32) int64

update user_dialogs set is_pinned = :is_pinned where user_id = :user_id and peer_type = :peer_type and peer_id = :peer_id TODO(@benqi): sqlmap

func (*UserDialogsDAO) UpdateReadOutboxMaxIdByPeer

func (dao *UserDialogsDAO) UpdateReadOutboxMaxIdByPeer(read_outbox_max_id int32, user_id int32, peer_type int8, peer_id int32) int64

update user_dialogs set read_outbox_max_id = :read_outbox_max_id where user_id = :user_id and peer_type = :peer_type and peer_id = :peer_id TODO(@benqi): sqlmap

func (*UserDialogsDAO) UpdateTopMessage

func (dao *UserDialogsDAO) UpdateTopMessage(top_message int32, date2 int32, user_id int32, peer_type int8, peer_id int32) int64

update user_dialogs set top_message = :top_message, date2 = :date2 where user_id = :user_id and peer_type = :peer_type and peer_id = :peer_id TODO(@benqi): sqlmap

func (*UserDialogsDAO) UpdateTopMessageAndClearDraft

func (dao *UserDialogsDAO) UpdateTopMessageAndClearDraft(top_message int32, date2 int32, user_id int32, peer_type int8, peer_id int32) int64

update user_dialogs set top_message = :top_message, draft_type = 0, draft_message_data = ”, date2 = :date2 where user_id = :user_id and peer_type = :peer_type and peer_id = :peer_id TODO(@benqi): sqlmap

func (*UserDialogsDAO) UpdateTopMessageAndMentions

func (dao *UserDialogsDAO) UpdateTopMessageAndMentions(top_message int32, date2 int32, user_id int32, peer_type int8, peer_id int32) int64

update user_dialogs set top_message = :top_message, unread_mentions_count = unread_mentions_count + 1, date2 = :date2 where user_id = :user_id and peer_type = :peer_type and peer_id = :peer_id TODO(@benqi): sqlmap

func (*UserDialogsDAO) UpdateTopMessageAndMentionsAndClearDraft

func (dao *UserDialogsDAO) UpdateTopMessageAndMentionsAndClearDraft(top_message int32, date2 int32, user_id int32, peer_type int8, peer_id int32) int64

update user_dialogs set top_message = :top_message, unread_mentions_count = unread_mentions_count + 1, draft_type = 0, draft_message_data = ”, date2 = :date2 where user_id = :user_id and peer_type = :peer_type and peer_id = :peer_id TODO(@benqi): sqlmap

func (*UserDialogsDAO) UpdateTopMessageAndUnread

func (dao *UserDialogsDAO) UpdateTopMessageAndUnread(top_message int32, date2 int32, user_id int32, peer_type int8, peer_id int32) int64

update user_dialogs set top_message = :top_message, unread_count = unread_count + 1, date2 = :date2 where user_id = :user_id and peer_type = :peer_type and peer_id = :peer_id TODO(@benqi): sqlmap

func (*UserDialogsDAO) UpdateTopMessageAndUnreadAndMentions

func (dao *UserDialogsDAO) UpdateTopMessageAndUnreadAndMentions(top_message int32, date2 int32, user_id int32, peer_type int8, peer_id int32) int64

update user_dialogs set top_message = :top_message, unread_count = unread_count + 1, unread_mentions_count = unread_mentions_count + 1, date2 = :date2 where user_id = :user_id and peer_type = :peer_type and peer_id = :peer_id TODO(@benqi): sqlmap

func (*UserDialogsDAO) UpdateUnreadByPeer

func (dao *UserDialogsDAO) UpdateUnreadByPeer(read_inbox_max_id int32, user_id int32, peer_type int8, peer_id int32) int64

update user_dialogs set unread_count = 0, read_inbox_max_id = :read_inbox_max_id where user_id = :user_id and peer_type = :peer_type and peer_id = :peer_id TODO(@benqi): sqlmap

type UserNotifySettingsDAO

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

func NewUserNotifySettingsDAO

func NewUserNotifySettingsDAO(db *sqlx.DB) *UserNotifySettingsDAO

func (*UserNotifySettingsDAO) DeleteNotAll

func (dao *UserNotifySettingsDAO) DeleteNotAll(user_id int32) int64

update user_notify_settings set is_deleted = 1 where user_id = :user_id and peer_type != 7 TODO(@benqi): sqlmap

func (*UserNotifySettingsDAO) Insert

insert into user_notify_settings(user_id, peer_type, peer_id, show_previews, silent, mute_until, sound) values (:user_id, :peer_type, :peer_id, :show_previews, :silent, :mute_until, :sound) TODO(@benqi): sqlmap

func (*UserNotifySettingsDAO) SelectByAll

func (dao *UserNotifySettingsDAO) SelectByAll(user_id int32) *dataobject.UserNotifySettingsDO

select id, show_previews, silent, mute_until, sound from user_notify_settings where user_id = :user_id and peer_type = 7 TODO(@benqi): sqlmap

func (*UserNotifySettingsDAO) SelectByChannels

func (dao *UserNotifySettingsDAO) SelectByChannels(user_id int32) *dataobject.UserNotifySettingsDO

select id, show_previews, silent, mute_until, sound from user_notify_settings where user_id = :user_id and peer_type = 6 TODO(@benqi): sqlmap

func (*UserNotifySettingsDAO) SelectByPeer

func (dao *UserNotifySettingsDAO) SelectByPeer(user_id int32, peer_type int8, peer_id int32) *dataobject.UserNotifySettingsDO

select id, show_previews, silent, mute_until, sound from user_notify_settings where user_id = :user_id and peer_type = :peer_type and peer_id = :peer_id TODO(@benqi): sqlmap

func (*UserNotifySettingsDAO) SelectByUserId

func (dao *UserNotifySettingsDAO) SelectByUserId(user_id int32) []dataobject.UserNotifySettingsDO

select id, show_previews, silent, mute_until, sound from user_notify_settings where user_id = :user_id TODO(@benqi): sqlmap

func (*UserNotifySettingsDAO) SelectByUsers

func (dao *UserNotifySettingsDAO) SelectByUsers(user_id int32) *dataobject.UserNotifySettingsDO

select id, show_previews, silent, mute_until, sound from user_notify_settings where user_id = :user_id and peer_type = 5 TODO(@benqi): sqlmap

func (*UserNotifySettingsDAO) UpdateByPeer

func (dao *UserNotifySettingsDAO) UpdateByPeer(show_previews int8, silent int8, mute_until int32, sound string, is_deleted int8, user_id int32, peer_type int8, peer_id int32) int64

update user_notify_settings set show_previews = :show_previews, silent = :silent, mute_until = :mute_until, sound = :sound, is_deleted = :is_deleted where user_id = :user_id and peer_type = :peer_type and peer_id = :peer_id TODO(@benqi): sqlmap

type UserPasswordsDAO

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

func NewUserPasswordsDAO

func NewUserPasswordsDAO(db *sqlx.DB) *UserPasswordsDAO

func (*UserPasswordsDAO) Insert

insert into user_passwords(user_id, server_salt, hash, salt, hint, email, state) values (:user_id, :server_salt, ”, ”, ”, ”, 0) TODO(@benqi): sqlmap

func (*UserPasswordsDAO) SelectByUserId

func (dao *UserPasswordsDAO) SelectByUserId(user_id int32) *dataobject.UserPasswordsDO

select user_id, server_salt, hash, salt, hint, email, state from user_passwords where user_id = :user_id limit 1 TODO(@benqi): sqlmap

func (*UserPasswordsDAO) SelectCode

func (dao *UserPasswordsDAO) SelectCode(user_id int32) *dataobject.UserPasswordsDO

select code, code_expired, attempts from user_passwords where user_id = :user_id limit 1 TODO(@benqi): sqlmap

func (*UserPasswordsDAO) Update

func (dao *UserPasswordsDAO) Update(salt string, hash string, hint string, email string, state int8, user_id int32) int64

update user_passwords set salt = :salt, hash = :hash, hint = :hint, email = :email, state = :state where user_id = :user_id TODO(@benqi): sqlmap

type UserPresencesDAO

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

func NewUserPresencesDAO

func NewUserPresencesDAO(db *sqlx.DB) *UserPresencesDAO

func (*UserPresencesDAO) Insert

insert into user_presences(user_id, last_seen_at, last_seen_auth_key_id, created_at) values (:user_id, :last_seen_at, :last_seen_auth_key_id, :created_at) TODO(@benqi): sqlmap

func (*UserPresencesDAO) SelectByUserID

func (dao *UserPresencesDAO) SelectByUserID(user_id int32) *dataobject.UserPresencesDO

select last_seen_at from user_presences where user_id = :user_id TODO(@benqi): sqlmap

func (*UserPresencesDAO) SelectByUserIDList

func (dao *UserPresencesDAO) SelectByUserIDList(idList []int32) *dataobject.UserPresencesDO

select user_id, last_seen_at from user_presences where user_id in (:idList) order by user_id asc TODO(@benqi): sqlmap

func (*UserPresencesDAO) UpdateLastSeen

func (dao *UserPresencesDAO) UpdateLastSeen(last_seen_at int64, last_seen_auth_key_id int64, user_id int32) int64

update user_presences set last_seen_at = :last_seen_at, last_seen_auth_key_id = :last_seen_auth_key_id, version = version + 1 where user_id = :user_id TODO(@benqi): sqlmap

type UserPrivacysDAO

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

func NewUserPrivacysDAO

func NewUserPrivacysDAO(db *sqlx.DB) *UserPrivacysDAO

func (*UserPrivacysDAO) Insert

insert into user_privacys(user_id, key_type, rules) values (:user_id, :key_type, :rules) TODO(@benqi): sqlmap

func (*UserPrivacysDAO) SelectPrivacy

func (dao *UserPrivacysDAO) SelectPrivacy(user_id int32, key_type int8) *dataobject.UserPrivacysDO

select id, user_id, key_type, rules from user_privacys where user_id = :user_id and key_type = :key_type TODO(@benqi): sqlmap

func (*UserPrivacysDAO) UpdatePrivacy

func (dao *UserPrivacysDAO) UpdatePrivacy(rules string, user_id int32, key_type int8) int64

update user_privacys set rules = :rules where user_id = :user_id and :key_type TODO(@benqi): sqlmap

type UserPtsUpdatesDAO

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

func NewUserPtsUpdatesDAO

func NewUserPtsUpdatesDAO(db *sqlx.DB) *UserPtsUpdatesDAO

func (*UserPtsUpdatesDAO) Insert

insert into user_pts_updates(user_id, pts, pts_count, update_type, update_data, date2) values (:user_id, :pts, :pts_count, :update_type, :update_data, :date2) TODO(@benqi): sqlmap

func (*UserPtsUpdatesDAO) SelectByGtPts

func (dao *UserPtsUpdatesDAO) SelectByGtPts(user_id int32, pts int32) []dataobject.UserPtsUpdatesDO

select user_id, pts, pts_count, update_type, update_data from user_pts_updates where user_id = :user_id and pts > :pts order by pts asc TODO(@benqi): sqlmap

func (*UserPtsUpdatesDAO) SelectLastPts

func (dao *UserPtsUpdatesDAO) SelectLastPts(user_id int32) *dataobject.UserPtsUpdatesDO

select pts from user_pts_updates where user_id = :user_id order by pts desc limit 1 TODO(@benqi): sqlmap

type UserQtsUpdatesDAO

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

func NewUserQtsUpdatesDAO

func NewUserQtsUpdatesDAO(db *sqlx.DB) *UserQtsUpdatesDAO

func (*UserQtsUpdatesDAO) Insert

insert into user_qts_updates(user_id, qts, update_type, update_data, date2) values (:user_id, :qts, :update_type, :update_data, :date2) TODO(@benqi): sqlmap

func (*UserQtsUpdatesDAO) SelectByGtQts

func (dao *UserQtsUpdatesDAO) SelectByGtQts(user_id int32, qts int32) []dataobject.UserQtsUpdatesDO

select user_id, qts, update_type, update_data, date2 from user_qts_updates where user_id = :user_id and qts > :qts order by qts asc TODO(@benqi): sqlmap

func (*UserQtsUpdatesDAO) SelectLastQts

func (dao *UserQtsUpdatesDAO) SelectLastQts(user_id int32) *dataobject.UserQtsUpdatesDO

select qts from user_qts_updates where user_id = :user_id order by qts desc limit 1 TODO(@benqi): sqlmap

type UsernameDAO

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

func NewUsernameDAO

func NewUsernameDAO(db *sqlx.DB) *UsernameDAO

func (*UsernameDAO) Insert

func (dao *UsernameDAO) Insert(do *dataobject.UsernameDO) int64

insert into username(peer_type, peer_id, username) values (:peer_type, :peer_id, :username) TODO(@benqi): sqlmap

func (*UsernameDAO) SelectByChannelId

func (dao *UsernameDAO) SelectByChannelId(peer_id int32) *dataobject.UsernameDO

select peer_type, peer_id, username from username where peer_type = 4 and peer_id = :peer_id TODO(@benqi): sqlmap

func (*UsernameDAO) SelectByPeer

func (dao *UsernameDAO) SelectByPeer(peer_type int8, peer_id int32) *dataobject.UsernameDO

select peer_type, peer_id, username from username where peer_type = :peer_type and peer_id = :peer_id TODO(@benqi): sqlmap

func (*UsernameDAO) SelectByUserId

func (dao *UsernameDAO) SelectByUserId(peer_id int32) *dataobject.UsernameDO

select peer_type, peer_id, username from username where peer_type = 2 and peer_id = :peer_id TODO(@benqi): sqlmap

func (*UsernameDAO) SelectByUsername

func (dao *UsernameDAO) SelectByUsername(username string) *dataobject.UsernameDO

select peer_type, peer_id, username from username where username = :username TODO(@benqi): sqlmap

func (*UsernameDAO) UpdateUsername

func (dao *UsernameDAO) UpdateUsername(username string, peer_type int8, peer_id int32) int64

update username set username = :username where peer_type = :peer_type and peer_id = :peer_id TODO(@benqi): sqlmap

type UsersDAO

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

func NewUsersDAO

func NewUsersDAO(db *sqlx.DB) *UsersDAO

func (*UsersDAO) Banned

func (dao *UsersDAO) Banned(banned int64, banned_reason string, banned_at string, id int32) int64

update users set banned = :banned, banned_reason = :banned_reason, banned_at = :banned_at where id = :id TODO(@benqi): sqlmap

func (*UsersDAO) Delete

func (dao *UsersDAO) Delete(deleted_reason string, deleted_at string, id int32) int64

update users set deleted = 1, deleted_reason = :deleted_reason, deleted_at = :deleted_at where id = :id TODO(@benqi): sqlmap

func (*UsersDAO) Insert

func (dao *UsersDAO) Insert(do *dataobject.UsersDO) int64

insert into users(first_name, last_name, access_hash, username, phone, country_code, bio, about, is_bot) values (:first_name, :last_name, :access_hash, :username, :phone, :country_code, :bio, :about, :is_bot) TODO(@benqi): sqlmap

func (*UsersDAO) SearchByQueryNotIdList

func (dao *UsersDAO) SearchByQueryNotIdList(q2 string, id_list []int32, limit int32) []dataobject.UsersDO

select id from users where username like :q2 and id not in (:id_list) limit :limit TODO(@benqi): sqlmap

func (*UsersDAO) SelectAccountDaysTTL

func (dao *UsersDAO) SelectAccountDaysTTL(id int32) *dataobject.UsersDO

select account_days_ttl from users where id = :id TODO(@benqi): sqlmap

func (*UsersDAO) SelectById

func (dao *UsersDAO) SelectById(id int32) *dataobject.UsersDO

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

func (*UsersDAO) SelectByPhoneNumber

func (dao *UsersDAO) SelectByPhoneNumber(phone string) *dataobject.UsersDO

select id, access_hash, first_name, last_name, username, banned, photos 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) []dataobject.UsersDO

select id, access_hash, first_name, last_name, username, phone, photos 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) SelectByUsername

func (dao *UsersDAO) SelectByUsername(username string) *dataobject.UsersDO

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

func (*UsersDAO) SelectCountryCode

func (dao *UsersDAO) SelectCountryCode(id int32) *dataobject.UsersDO

select country_code from users where id = :id TODO(@benqi): sqlmap

func (*UsersDAO) SelectProfilePhotos

func (dao *UsersDAO) SelectProfilePhotos(id int32) *dataobject.UsersDO

select photos from users where id = :id TODO(@benqi): sqlmap

func (*UsersDAO) SelectUsersByIdList

func (dao *UsersDAO) SelectUsersByIdList(id_list []int32) []dataobject.UsersDO

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

func (*UsersDAO) SelectUsersByPhoneList

func (dao *UsersDAO) SelectUsersByPhoneList(phoneList []string) []dataobject.UsersDO

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

func (*UsersDAO) UpdateAbout

func (dao *UsersDAO) UpdateAbout(about string, id int32) int64

update users set about = :about where id = :id TODO(@benqi): sqlmap

func (*UsersDAO) UpdateAccountDaysTTL

func (dao *UsersDAO) UpdateAccountDaysTTL(account_days_ttl int32, id int32) int64

update users set account_days_ttl = :account_days_ttl where id = :id TODO(@benqi): sqlmap

func (*UsersDAO) UpdateFirstAndLastName

func (dao *UsersDAO) UpdateFirstAndLastName(first_name string, last_name string, id int32) int64

update users set first_name = :first_name, last_name = :last_name where id = :id TODO(@benqi): sqlmap

func (*UsersDAO) UpdateProfile

func (dao *UsersDAO) UpdateProfile(first_name string, last_name string, about string, id int32) int64

update users set first_name = :first_name, last_name = :last_name, about = :about where id = :id TODO(@benqi): sqlmap

func (*UsersDAO) UpdateProfilePhotos

func (dao *UsersDAO) UpdateProfilePhotos(photos string, id int32) int64

update users set photos = :photos where id = :id TODO(@benqi): sqlmap

func (*UsersDAO) UpdateUsername

func (dao *UsersDAO) UpdateUsername(username string, id int32) int64

update users set username = :username where id = :id TODO(@benqi): sqlmap

type WallPapersDAO

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

func NewWallPapersDAO

func NewWallPapersDAO(db *sqlx.DB) *WallPapersDAO

func (*WallPapersDAO) Insert

func (dao *WallPapersDAO) Insert(do *dataobject.WallPapersDO) int64

insert into wall_papers(type, title, color, bg_color, photo_id) values (:type, :title, :color, :bg_color, :photo_id) TODO(@benqi): sqlmap

func (*WallPapersDAO) SelectAll

func (dao *WallPapersDAO) SelectAll() []dataobject.WallPapersDO

select id, type, title, color, bg_color, photo_id from wall_papers where deleted_at = 0 TODO(@benqi): sqlmap

Jump to

Keyboard shortcuts

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