Merge remote-tracking branch 'upstream/main' into merge-gramsrv-2965f5d

This commit is contained in:
onysd 2026-07-20 23:43:51 +03:00
commit ebb0be38d9
355 changed files with 44640 additions and 2320 deletions

View file

@ -167,7 +167,7 @@ func (q *Queries) InsertBot(ctx context.Context, arg InsertBotParams) error {
const insertBotUser = `-- name: InsertBotUser :one
INSERT INTO users (access_hash, phone, first_name, last_name, username, country_code, is_bot, bot_info_version)
VALUES ($1, '', $2, '', $3, '', TRUE, 1)
RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, signup_email
RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, signup_email
`
type InsertBotUserParams struct {
@ -209,6 +209,13 @@ func (q *Queries) InsertBotUser(ctx context.Context, arg InsertBotUserParams) (U
&i.BirthdayMonth,
&i.BirthdayYear,
&i.PersonalChannelID,
&i.DeletedAt,
&i.DeletionSource,
&i.DeletionReason,
&i.AccountDeleteAt,
&i.EmojiStatusCollectibleID,
&i.EmojiStatusCollectible,
&i.LinkedCommunityID,
&i.SignupEmail,
)
return i, err

View file

@ -67,6 +67,8 @@ SELECT
u.premium_expires_at,
u.emoji_status_document_id,
u.emoji_status_until,
u.emoji_status_collectible_id,
u.emoji_status_collectible,
u.last_seen_at
FROM contacts c
JOIN users u ON u.id = c.contact_user_id
@ -80,29 +82,31 @@ type GetContactParams struct {
}
type GetContactRow struct {
ContactUserID int64
Mutual bool
CloseFriend bool
ContactPhone string
ContactFirstName string
ContactLastName string
Note string
NoteEntitiesJson string
ID int64
AccessHash int64
Phone string
FirstName string
LastName string
Username string
CountryCode string
Verified bool
Support bool
IsBot bool
BotInfoVersion int32
PremiumExpiresAt pgtype.Timestamptz
EmojiStatusDocumentID int64
EmojiStatusUntil int64
LastSeenAt int64
ContactUserID int64
Mutual bool
CloseFriend bool
ContactPhone string
ContactFirstName string
ContactLastName string
Note string
NoteEntitiesJson string
ID int64
AccessHash int64
Phone string
FirstName string
LastName string
Username string
CountryCode string
Verified bool
Support bool
IsBot bool
BotInfoVersion int32
PremiumExpiresAt pgtype.Timestamptz
EmojiStatusDocumentID int64
EmojiStatusUntil int64
EmojiStatusCollectibleID *int64
EmojiStatusCollectible []byte
LastSeenAt int64
}
func (q *Queries) GetContact(ctx context.Context, arg GetContactParams) (GetContactRow, error) {
@ -131,6 +135,8 @@ func (q *Queries) GetContact(ctx context.Context, arg GetContactParams) (GetCont
&i.PremiumExpiresAt,
&i.EmojiStatusDocumentID,
&i.EmojiStatusUntil,
&i.EmojiStatusCollectibleID,
&i.EmojiStatusCollectible,
&i.LastSeenAt,
)
return i, err
@ -160,6 +166,8 @@ SELECT
u.premium_expires_at,
u.emoji_status_document_id,
u.emoji_status_until,
u.emoji_status_collectible_id,
u.emoji_status_collectible,
u.last_seen_at
FROM contacts c
JOIN users u ON u.id = c.contact_user_id
@ -168,29 +176,31 @@ ORDER BY c.contact_first_name, c.contact_last_name, u.first_name, u.last_name, u
`
type ListContactsByUserRow struct {
ContactUserID int64
Mutual bool
CloseFriend bool
ContactPhone string
ContactFirstName string
ContactLastName string
Note string
NoteEntitiesJson string
ID int64
AccessHash int64
Phone string
FirstName string
LastName string
Username string
CountryCode string
Verified bool
Support bool
IsBot bool
BotInfoVersion int32
PremiumExpiresAt pgtype.Timestamptz
EmojiStatusDocumentID int64
EmojiStatusUntil int64
LastSeenAt int64
ContactUserID int64
Mutual bool
CloseFriend bool
ContactPhone string
ContactFirstName string
ContactLastName string
Note string
NoteEntitiesJson string
ID int64
AccessHash int64
Phone string
FirstName string
LastName string
Username string
CountryCode string
Verified bool
Support bool
IsBot bool
BotInfoVersion int32
PremiumExpiresAt pgtype.Timestamptz
EmojiStatusDocumentID int64
EmojiStatusUntil int64
EmojiStatusCollectibleID *int64
EmojiStatusCollectible []byte
LastSeenAt int64
}
func (q *Queries) ListContactsByUser(ctx context.Context, userID int64) ([]ListContactsByUserRow, error) {
@ -225,6 +235,8 @@ func (q *Queries) ListContactsByUser(ctx context.Context, userID int64) ([]ListC
&i.PremiumExpiresAt,
&i.EmojiStatusDocumentID,
&i.EmojiStatusUntil,
&i.EmojiStatusCollectibleID,
&i.EmojiStatusCollectible,
&i.LastSeenAt,
); err != nil {
return nil, err
@ -270,6 +282,8 @@ SELECT
u.premium_expires_at,
u.emoji_status_document_id,
u.emoji_status_until,
u.emoji_status_collectible_id,
u.emoji_status_collectible,
u.last_seen_at
FROM updated c
JOIN users u ON u.id = c.contact_user_id
@ -283,29 +297,31 @@ type UpdateContactNoteParams struct {
}
type UpdateContactNoteRow struct {
ContactUserID int64
Mutual bool
CloseFriend bool
ContactPhone string
ContactFirstName string
ContactLastName string
Note string
NoteEntitiesJson string
ID int64
AccessHash int64
Phone string
FirstName string
LastName string
Username string
CountryCode string
Verified bool
Support bool
IsBot bool
BotInfoVersion int32
PremiumExpiresAt pgtype.Timestamptz
EmojiStatusDocumentID int64
EmojiStatusUntil int64
LastSeenAt int64
ContactUserID int64
Mutual bool
CloseFriend bool
ContactPhone string
ContactFirstName string
ContactLastName string
Note string
NoteEntitiesJson string
ID int64
AccessHash int64
Phone string
FirstName string
LastName string
Username string
CountryCode string
Verified bool
Support bool
IsBot bool
BotInfoVersion int32
PremiumExpiresAt pgtype.Timestamptz
EmojiStatusDocumentID int64
EmojiStatusUntil int64
EmojiStatusCollectibleID *int64
EmojiStatusCollectible []byte
LastSeenAt int64
}
func (q *Queries) UpdateContactNote(ctx context.Context, arg UpdateContactNoteParams) (UpdateContactNoteRow, error) {
@ -339,6 +355,8 @@ func (q *Queries) UpdateContactNote(ctx context.Context, arg UpdateContactNotePa
&i.PremiumExpiresAt,
&i.EmojiStatusDocumentID,
&i.EmojiStatusUntil,
&i.EmojiStatusCollectibleID,
&i.EmojiStatusCollectible,
&i.LastSeenAt,
)
return i, err
@ -416,6 +434,8 @@ SELECT
u.premium_expires_at,
u.emoji_status_document_id,
u.emoji_status_until,
u.emoji_status_collectible_id,
u.emoji_status_collectible,
u.last_seen_at,
EXISTS (SELECT 1 FROM reverse_updated)::boolean AS reverse_mutual_changed
FROM upserted c
@ -433,30 +453,32 @@ type UpsertContactParams struct {
}
type UpsertContactRow struct {
ContactUserID int64
Mutual bool
CloseFriend bool
ContactPhone string
ContactFirstName string
ContactLastName string
Note string
NoteEntitiesJson string
ID int64
AccessHash int64
Phone string
FirstName string
LastName string
Username string
CountryCode string
Verified bool
Support bool
IsBot bool
BotInfoVersion int32
PremiumExpiresAt pgtype.Timestamptz
EmojiStatusDocumentID int64
EmojiStatusUntil int64
LastSeenAt int64
ReverseMutualChanged bool
ContactUserID int64
Mutual bool
CloseFriend bool
ContactPhone string
ContactFirstName string
ContactLastName string
Note string
NoteEntitiesJson string
ID int64
AccessHash int64
Phone string
FirstName string
LastName string
Username string
CountryCode string
Verified bool
Support bool
IsBot bool
BotInfoVersion int32
PremiumExpiresAt pgtype.Timestamptz
EmojiStatusDocumentID int64
EmojiStatusUntil int64
EmojiStatusCollectibleID *int64
EmojiStatusCollectible []byte
LastSeenAt int64
ReverseMutualChanged bool
}
func (q *Queries) UpsertContact(ctx context.Context, arg UpsertContactParams) (UpsertContactRow, error) {
@ -493,6 +515,8 @@ func (q *Queries) UpsertContact(ctx context.Context, arg UpsertContactParams) (U
&i.PremiumExpiresAt,
&i.EmojiStatusDocumentID,
&i.EmojiStatusUntil,
&i.EmojiStatusCollectibleID,
&i.EmojiStatusCollectible,
&i.LastSeenAt,
&i.ReverseMutualChanged,
)

View file

@ -19,14 +19,18 @@ WHERE m.owner_user_id = $1::bigint
OR (m.peer_type = $3::text AND m.peer_id = $4::bigint)
)
AND (
$5::text = ''
OR m.body ILIKE ('%' || $5::text || '%')
NOT $5::boolean
OR (m.peer_type = 'user' AND m.peer_id = ANY($6::bigint[]))
)
AND ($6::int <= 0 OR m.box_id < $6::int)
AND ($7::int <= 0 OR m.box_id > $7::int)
AND (NOT $8::boolean OR m.pinned)
AND (
NOT $9::boolean
$7::text = ''
OR m.body ILIKE ('%' || $7::text || '%')
)
AND ($8::int <= 0 OR m.box_id < $8::int)
AND ($9::int <= 0 OR m.box_id > $9::int)
AND (NOT $10::boolean OR m.pinned)
AND (
NOT $11::boolean
OR (
m.media->>'kind' = 'document'
AND EXISTS (
@ -38,23 +42,25 @@ WHERE m.owner_user_id = $1::bigint
)
)
AND (
$10::text = ''
OR (m.saved_peer_type = $10::text AND m.saved_peer_id = $11::bigint)
$12::text = ''
OR (m.saved_peer_type = $12::text AND m.saved_peer_id = $13::bigint)
)
`
type CountMessagesByUserParams struct {
OwnerUserID int64
HasPeer bool
PeerType string
PeerID int64
Query string
MaxID int32
MinID int32
PinnedOnly bool
MusicOnly bool
SavedPeerType string
SavedPeerID int64
OwnerUserID int64
HasPeer bool
PeerType string
PeerID int64
RestrictPeerIds bool
PeerIds []int64
Query string
MaxID int32
MinID int32
PinnedOnly bool
MusicOnly bool
SavedPeerType string
SavedPeerID int64
}
// ListMessagesByUser total CTE 的独立化:相同 base 过滤(不含分页 anchor),
@ -65,6 +71,8 @@ func (q *Queries) CountMessagesByUser(ctx context.Context, arg CountMessagesByUs
arg.HasPeer,
arg.PeerType,
arg.PeerID,
arg.RestrictPeerIds,
arg.PeerIds,
arg.Query,
arg.MaxID,
arg.MinID,
@ -2280,14 +2288,18 @@ WHERE m.owner_user_id = $1::bigint
OR (m.peer_type = $3::text AND m.peer_id = $4::bigint)
)
AND (
$5::text = ''
OR m.body ILIKE ('%' || $5::text || '%')
NOT $5::boolean
OR (m.peer_type = 'user' AND m.peer_id = ANY($6::bigint[]))
)
AND ($6::int <= 0 OR m.box_id < $6::int)
AND ($7::int <= 0 OR m.box_id > $7::int)
AND (NOT $8::boolean OR m.pinned)
AND (
NOT $9::boolean
$7::text = ''
OR m.body ILIKE ('%' || $7::text || '%')
)
AND ($8::int <= 0 OR m.box_id < $8::int)
AND ($9::int <= 0 OR m.box_id > $9::int)
AND (NOT $10::boolean OR m.pinned)
AND (
NOT $11::boolean
OR (
m.media->>'kind' = 'document'
AND EXISTS (
@ -2299,34 +2311,36 @@ WHERE m.owner_user_id = $1::bigint
)
)
AND (
$10::text = ''
OR (m.saved_peer_type = $10::text AND m.saved_peer_id = $11::bigint)
$12::text = ''
OR (m.saved_peer_type = $12::text AND m.saved_peer_id = $13::bigint)
)
AND (
($12::int > 0 AND m.message_date < $12::int)
OR ($12::int <= 0 AND ($13::int <= 0 OR m.box_id < $13::int))
($14::int > 0 AND m.message_date < $14::int)
OR ($14::int <= 0 AND ($15::int <= 0 OR m.box_id < $15::int))
)
ORDER BY m.box_id DESC
OFFSET GREATEST($14::int, 0)
LIMIT $15::int
OFFSET GREATEST($16::int, 0)
LIMIT $17::int
`
type ListMessagesBackwardParams struct {
OwnerUserID int64
HasPeer bool
PeerType string
PeerID int64
Query string
MaxID int32
MinID int32
PinnedOnly bool
MusicOnly bool
SavedPeerType string
SavedPeerID int64
OffsetDate int32
OffsetID int32
RowOffset int32
LimitCount int32
OwnerUserID int64
HasPeer bool
PeerType string
PeerID int64
RestrictPeerIds bool
PeerIds []int64
Query string
MaxID int32
MinID int32
PinnedOnly bool
MusicOnly bool
SavedPeerType string
SavedPeerID int64
OffsetDate int32
OffsetID int32
RowOffset int32
LimitCount int32
}
type ListMessagesBackwardRow struct {
@ -2416,6 +2430,8 @@ func (q *Queries) ListMessagesBackward(ctx context.Context, arg ListMessagesBack
arg.HasPeer,
arg.PeerType,
arg.PeerID,
arg.RestrictPeerIds,
arg.PeerIds,
arg.Query,
arg.MaxID,
arg.MinID,
@ -2618,14 +2634,18 @@ base AS NOT MATERIALIZED (
OR (m.peer_type = $7::text AND m.peer_id = $8::bigint)
)
AND (
$9::text = ''
OR m.body ILIKE ('%' || $9::text || '%')
NOT $9::boolean
OR (m.peer_type = 'user' AND m.peer_id = ANY($10::bigint[]))
)
AND ($10::int <= 0 OR m.box_id < $10::int)
AND ($11::int <= 0 OR m.box_id > $11::int)
AND (NOT $12::boolean OR m.pinned)
AND (
NOT $13::boolean
$11::text = ''
OR m.body ILIKE ('%' || $11::text || '%')
)
AND ($12::int <= 0 OR m.box_id < $12::int)
AND ($13::int <= 0 OR m.box_id > $13::int)
AND (NOT $14::boolean OR m.pinned)
AND (
NOT $15::boolean
OR (
m.media->>'kind' = 'document'
AND EXISTS (
@ -2637,14 +2657,14 @@ base AS NOT MATERIALIZED (
)
)
AND (
$14::text = ''
OR (m.saved_peer_type = $14::text AND m.saved_peer_id = $15::bigint)
$16::text = ''
OR (m.saved_peer_type = $16::text AND m.saved_peer_id = $17::bigint)
)
),
total AS (
SELECT count(*)::int AS total_count
FROM base
WHERE $16::boolean
WHERE $18::boolean
),
backward AS (
SELECT b.box_id, b.private_message_id, b.owner_user_id, b.peer_type, b.peer_id, b.from_user_id, b.message_date, b.ttl_period, b.expires_at, b.edit_date, b.hide_edited, b.outgoing, b.body, b.entities_json, b.silent, b.noforwards, b.reply_to_msg_id, b.reply_to_peer_type, b.reply_to_peer_id, b.reply_to_top_id, b.reply_to_story_id, b.quote_text, b.quote_entities_json, b.quote_offset, b.fwd_from_peer_type, b.fwd_from_peer_id, b.fwd_from_name, b.fwd_date, b.fwd_saved_from_peer_type, b.fwd_saved_from_peer_id, b.fwd_saved_from_msg_id, b.saved_peer_type, b.saved_peer_id, b.pts, b.media_json, b.media_unread, b.reaction_unread, b.pinned, b.via_bot_id, b.grouped_id, b.effect, b.reply_markup_json, b.rich_message_json, b.peer_user_id, b.peer_access_hash, b.peer_phone, b.peer_first_name, b.peer_last_name, b.peer_username, b.peer_country_code, b.peer_verified, b.peer_support, b.peer_is_bot, b.peer_bot_info_version, b.peer_premium_until, b.peer_emoji_status_document_id, b.peer_emoji_status_until, b.peer_last_seen_at, b.from_user_user_id, b.from_user_access_hash, b.from_user_phone, b.from_user_first_name, b.from_user_last_name, b.from_user_username, b.from_user_country_code, b.from_user_verified, b.from_user_support, b.from_user_is_bot, b.from_user_bot_info_version, b.from_user_premium_until, b.from_user_emoji_status_document_id, b.from_user_emoji_status_until, b.from_user_last_seen_at
@ -2791,22 +2811,24 @@ ORDER BY box_id DESC
`
type ListMessagesByUserParams struct {
OwnerUserID int64
OffsetID int32
OffsetDate int32
AddOffset int32
LimitCount int32
HasPeer bool
PeerType string
PeerID int64
Query string
MaxID int32
MinID int32
PinnedOnly bool
MusicOnly bool
SavedPeerType string
SavedPeerID int64
NeedTotalCount bool
OwnerUserID int64
OffsetID int32
OffsetDate int32
AddOffset int32
LimitCount int32
HasPeer bool
PeerType string
PeerID int64
RestrictPeerIds bool
PeerIds []int64
Query string
MaxID int32
MinID int32
PinnedOnly bool
MusicOnly bool
SavedPeerType string
SavedPeerID int64
NeedTotalCount bool
}
type ListMessagesByUserRow struct {
@ -2896,6 +2918,8 @@ func (q *Queries) ListMessagesByUser(ctx context.Context, arg ListMessagesByUser
arg.HasPeer,
arg.PeerType,
arg.PeerID,
arg.RestrictPeerIds,
arg.PeerIds,
arg.Query,
arg.MaxID,
arg.MinID,

View file

@ -8,6 +8,32 @@ import (
"github.com/jackc/pgx/v5/pgtype"
)
type AccountDeletionNotification struct {
ID int64
TargetUserID int64
DeletedUserID int64
Status string
Attempts int32
NextAttemptAt pgtype.Timestamptz
LeaseUntil pgtype.Timestamptz
LastError string
CreatedAt pgtype.Timestamptz
UpdatedAt pgtype.Timestamptz
}
type AccountDeletionRequest struct {
ID int64
UserID int64
RequesterAuthKeyID int64
State string
Reason string
ConfirmHashDigest []byte
RequestedAt pgtype.Timestamptz
ExecuteAt pgtype.Timestamptz
CompletedAt pgtype.Timestamptz
UpdatedAt pgtype.Timestamptz
}
type AccountPassword struct {
UserID int64
HasRecovery bool
@ -30,6 +56,7 @@ type AccountPassword struct {
RecoveryCode string
RecoveryCodeExpiresAt pgtype.Timestamptz
LoginEmail string
PasswordChangedAt pgtype.Timestamptz
}
type AccountPrivacyRule struct {
@ -267,21 +294,49 @@ type Bot struct {
}
type BotApiUpdate struct {
ID int64
BotUserID int64
UpdateKind string
PeerType string
PeerID int64
MessageID int32
SourcePts int32
Date int32
CreatedAt pgtype.Timestamptz
ID int64
BotUserID int64
UpdateKind string
PeerType string
PeerID int64
MessageID int32
SourcePts int32
Date int32
CreatedAt pgtype.Timestamptz
CallbackQueryID int64
CallbackUserID int64
CallbackChatInstance int64
CallbackData []byte
CallbackInlineDcID int32
CallbackInlineOwnerID int64
CallbackInlineMessageID int32
CallbackInlineAccessHash int64
EphemeralPayload []byte
}
type BotApiUpdateState struct {
BotUserID int64
ConfirmedUpdateID int64
UpdatedAt pgtype.Timestamptz
AllowedUpdates []string
CursorInitialized bool
PollOwner string
PollExpiresAt pgtype.Timestamptz
}
type BotApiWebhook struct {
BotUserID int64
Url string
SecretToken string
MaxConnections int32
AllowedUpdates []string
FailureCount int32
LastErrorDate int32
LastErrorMessage string
NextAttemptAt pgtype.Timestamptz
DeliveryOwner string
DeliveryExpiresAt pgtype.Timestamptz
UpdatedAt pgtype.Timestamptz
}
type BotApp struct {
@ -448,6 +503,7 @@ type Channel struct {
LinkedMonoforumID int64
Wallpaper []byte
Verified bool
LinkedCommunityID int64
}
type ChannelAdminLogEvent struct {
@ -653,6 +709,8 @@ type ChannelMessage struct {
DeleteDate int32
DeleteMessageIds []byte
RequestFingerprint []byte
SuggestedPost []byte
PaidMessageStars int64
}
type ChannelMessageMedium struct {
@ -694,6 +752,42 @@ type ChannelMessageViewer struct {
CreatedAt pgtype.Timestamptz
}
type ChannelStarsBalance struct {
ChannelID int64
Balance int64
UpdatedAt pgtype.Timestamptz
}
type ChannelStarsTransaction struct {
ID int64
ChannelID int64
ActorUserID int64
Amount int64
Reason string
PeerType string
PeerID int64
GiftID *int64
Date int32
}
type ChannelTonBalance struct {
ChannelID int64
BalanceNanoton int64
UpdatedAt pgtype.Timestamptz
}
type ChannelTonTransaction struct {
ID int64
ChannelID int64
ActorUserID int64
AmountNanoton int64
Reason string
PeerType string
PeerID int64
GiftID *int64
Date int32
}
type ChannelTopicRead struct {
ChannelID int64
UserID int64
@ -767,6 +861,62 @@ type ChatlistMembership struct {
UpdatedAt pgtype.Timestamptz
}
type Community struct {
ID int64
AccessHash int64
CreatorUserID int64
Title string
About string
DefaultBannedRights []byte
PhotoID int64
PhotoDcID int32
PhotoStripped []byte
Date int32
Deleted bool
CreatedAt pgtype.Timestamptz
UpdatedAt pgtype.Timestamptz
}
type CommunityMember struct {
CommunityID int64
UserID int64
Role string
Status string
AdminRights []byte
Rank string
Date int32
UpdatedAt pgtype.Timestamptz
}
type CommunityPeerLink struct {
CommunityID int64
PeerType string
PeerID int64
Visibility string
CreatedBy int64
Date int32
CreatedAt pgtype.Timestamptz
}
type CommunityPeerLinkRequest struct {
CommunityID int64
PeerType string
PeerID int64
RequestedBy int64
Visibility string
Date int32
CreatedAt pgtype.Timestamptz
}
type CommunityUserState struct {
CommunityID int64
UserID int64
Collapsed bool
Pinned bool
PinnedOrder int32
UpdatedAt pgtype.Timestamptz
}
type Contact struct {
UserID int64
ContactUserID int64
@ -942,6 +1092,21 @@ type EncryptedStateEventDelivery struct {
AuthKeyID int64
}
type EphemeralAbuseReport struct {
ID int64
ReporterUserID int64
ChannelID int64
EphemeralMessageID int32
SenderUserID int64
ReceiverUserID int64
ReportOption string
ReportComment string
CommentHash []byte
PayloadHash []byte
Evidence []byte
CreatedAt pgtype.Timestamptz
}
type FileBlob struct {
LocationKey string
Backend string
@ -1156,19 +1321,33 @@ type PasskeyCredential struct {
}
type PeerStarGift struct {
ID int64
OwnerPeerID int64
FromUserID int64
GiftID int64
MsgID int32
GiftDate int32
NameHidden bool
Unsaved bool
Converted bool
ConvertStars int64
Message string
OwnerPeerType string
SavedID int64
ID int64
OwnerPeerID int64
FromUserID int64
GiftID int64
MsgID int32
GiftDate int32
NameHidden bool
Unsaved bool
Converted bool
ConvertStars int64
Message string
OwnerPeerType string
SavedID int64
CatalogRevisionID int64
UniqueGiftID *int64
UpgradeMsgID int32
PinnedOrder int32
PrepaidUpgradeStars int64
LifecycleStatus string
TransferStars int64
PrepaidUpgradeHash string
GiftNum int32
CanExportAt int32
CanTransferAt int32
CanResellAt int32
DropOriginalDetailsStars int64
CanCraftAt int32
}
type PeerTranslationSetting struct {
@ -1417,6 +1596,394 @@ type SeedState struct {
UpdatedAt pgtype.Timestamptz
}
type StarGiftAuction struct {
GiftID int64
Slug string
Version int32
StartDate int32
EndDate int32
RoundDuration int32
GiftsPerRound int32
TotalRounds int32
CurrentRound int32
NextRoundAt int32
LastGiftNum int32
GiftsLeft int32
MinBidAmount int64
Status string
UpdatedAt pgtype.Timestamptz
}
type StarGiftAuctionAcquired struct {
ID int64
GiftID int64
BidderUserID int64
RecipientPeerType string
RecipientPeerID int64
SavedGiftID *int64
BidAmount int64
Round int32
Pos int32
GiftNum *int32
AcquiredAt int32
HideName bool
Message string
}
type StarGiftAuctionBid struct {
GiftID int64
BidderUserID int64
RecipientPeerType string
RecipientPeerID int64
Amount int64
BidDate int32
HideName bool
Message string
Returned bool
AcquiredCount int32
Active bool
Version int64
}
type StarGiftAuctionBidPayment struct {
UserID int64
FormID int64
GiftID int64
BidAmount int64
BalanceAfter int64
CreatedAt int32
}
type StarGiftCatalog struct {
GiftID int64
ActiveRevisionID int64
Enabled bool
SortOrder int32
CreatedAt pgtype.Timestamptz
UpdatedAt pgtype.Timestamptz
CollectibleRevisionID *int64
AvailabilityRemains int32
AvailabilityResale int64
ResellMinStars int64
FirstSaleDate int32
LastSaleDate int32
}
type StarGiftCatalogRevision struct {
ID int64
GiftID int64
Revision int32
Title string
Stars int64
ConvertStars int64
DocumentID int64
AnimationJson []byte
AnimationSha256 []byte
SourceName string
SourceFormat string
Width int32
Height int32
FrameRate float64
InPoint float64
OutPoint float64
CreatedBy string
CommandID string
CreatedAt pgtype.Timestamptz
OfficialGiftID *int64
SourceManifestSha256 []byte
OfficialSource []byte
Limited bool
SoldOut bool
Birthday bool
RequirePremium bool
LimitedPerUser bool
PeerColorAvailable bool
Auction bool
AvailabilityTotal int32
ReleasedByPeerType *string
ReleasedByPeerID *int64
PerUserTotal int32
LockedUntilDate int32
AuctionSlug string
GiftsPerRound int32
AuctionStartDate int32
UpgradeVariants int32
BackgroundCenterColor *int32
BackgroundEdgeColor *int32
BackgroundTextColor *int32
}
type StarGiftCollectibleBackdrop struct {
ID int64
CollectibleRevisionID int64
Name string
BackdropID int32
CenterColor int32
EdgeColor int32
PatternColor int32
TextColor int32
RarityPermille *int32
SortOrder int32
RarityKind string
}
type StarGiftCollectibleModel struct {
ID int64
CollectibleRevisionID int64
Name string
DocumentID int64
AnimationJson []byte
AnimationSha256 []byte
SourceName string
SourceFormat string
Width int32
Height int32
FrameRate float64
InPoint float64
OutPoint float64
RarityPermille *int32
SortOrder int32
RarityKind string
Crafted bool
OfficialDocumentID *int64
}
type StarGiftCollectiblePattern struct {
ID int64
CollectibleRevisionID int64
Name string
DocumentID int64
AnimationJson []byte
AnimationSha256 []byte
SourceName string
SourceFormat string
Width int32
Height int32
FrameRate float64
InPoint float64
OutPoint float64
RarityPermille *int32
SortOrder int32
RarityKind string
OfficialDocumentID *int64
}
type StarGiftCollectibleRevision struct {
ID int64
GiftID int64
Revision int32
UpgradeStars int64
SupplyTotal int32
Issued int32
SlugPrefix string
Status string
CreatedBy string
CommandID string
CreatedAt pgtype.Timestamptz
PublishedAt pgtype.Timestamptz
OfficialGiftID *int64
SourceManifestSha256 []byte
}
type StarGiftCollection struct {
CollectionID int32
OwnerPeerType string
OwnerPeerID int64
Title string
SortOrder int32
Hash int64
CreatedAt pgtype.Timestamptz
UpdatedAt pgtype.Timestamptz
}
type StarGiftCollectionItem struct {
CollectionID int32
SavedGiftID int64
SortOrder int32
CreatedAt pgtype.Timestamptz
}
type StarGiftConversion struct {
SavedGiftID int64
ActorUserID int64
OwnerPeerType string
OwnerPeerID int64
Amount int64
BalanceAfter int64
ConvertedAt int32
}
type StarGiftCraftCommand struct {
UserID int64
CommandKey string
InputUniqueGiftIds []int64
GiftID int64
Success bool
ResultUniqueGiftID *int64
ChancePermille int32
CreatedAt int32
SourceEditPts []int32
}
type StarGiftDropDetailsCommand struct {
UserID int64
CommandKey string
SavedGiftID int64
UniqueGiftID int64
FormID int64
ChargeStars int64
BalanceAfter int64
CreatedAt int32
}
type StarGiftListing struct {
UniqueGiftID int64
SellerPeerType string
SellerPeerID int64
Currency string
Amount int64
ListedAt int32
UpdatedAt int32
Version int64
}
type StarGiftNotificationSetting struct {
UserID int64
ChannelID int64
Enabled bool
UpdatedAt pgtype.Timestamptz
}
type StarGiftOffer struct {
ID int64
BuyerUserID int64
OwnerPeerType string
OwnerPeerID int64
UniqueGiftID int64
Currency string
Amount int64
RandomID int64
OfferMsgID int32
BuyerMsgID int32
Status string
CreatedAt int32
ExpiresAt int32
ResolvedAt int32
BalanceAfter int64
ResolutionNotified bool
}
type StarGiftPatternDocumentRepair struct {
OldDocumentID int64
NewDocumentID int64
RepairedAt pgtype.Timestamptz
}
type StarGiftPatternPreviewDocumentRepair struct {
OldDocumentID int64
NewDocumentID int64
RepairedAt pgtype.Timestamptz
}
type StarGiftPrepaidUpgradeCommand struct {
PayerUserID int64
CommandKey string
SavedGiftID int64
FormID int64
ChargeStars int64
BalanceAfter int64
CreatedAt int32
}
type StarGiftPurchaseCommand struct {
BuyerUserID int64
CommandKey string
GiftID int64
RecipientPeerType string
RecipientPeerID int64
SavedGiftID int64
FormID int64
ChargeStars int64
BalanceAfter int64
CreatedAt int32
}
type StarGiftPurchaseForm struct {
BuyerUserID int64
FormID int64
GiftID int64
RevisionID int64
RecipientPeerType string
RecipientPeerID int64
IncludeUpgrade bool
HideName bool
Message string
ChargeStars int64
IssuedAt int32
ExpiresAt int32
}
type StarGiftSale struct {
ID int64
UniqueGiftID int64
SellerPeerType string
SellerPeerID int64
BuyerPeerType string
BuyerPeerID int64
Currency string
Amount int64
CommissionAmount int64
SoldAt int32
CommandKey string
}
type StarGiftTransferCommand struct {
ActorUserID int64
CommandKey string
UniqueGiftID int64
FromPeerType string
FromPeerID int64
ToPeerType string
ToPeerID int64
ChargeStars int64
BalanceAfter int64
CreatedAt int32
}
type StarGiftUpgradeCommand struct {
UserID int64
CommandKey string
SourceSavedGiftID int64
FormID int64
UniqueGiftID int64
BalanceAfter int64
CreatedAt pgtype.Timestamptz
ChargeStars int64
RequirePrepaid bool
KeepOriginalDetails bool
SourceEditPts int32
}
type StarGiftUserPurchase struct {
UserID int64
GiftID int64
PurchasedCount int32
UpdatedAt pgtype.Timestamptz
}
type StarGiftWithdrawalRequest struct {
ID int64
UniqueGiftID int64
OwnerUserID int64
Provider string
ProviderRequestID string
Url string
Status string
CreatedAt int32
ExpiresAt int32
CompletedAt int32
}
type StarsBalance struct {
UserID int64
Balance int64
@ -1533,6 +2100,28 @@ type StoryView struct {
UpdatedAt pgtype.Timestamptz
}
type TelesrvCollectiblePatternCorrectionEvent struct {
UserID int64
Pts int32
}
type TelesrvPatternPreviewCorrectionEvent struct {
UserID int64
Pts int32
}
type TelesrvPatternPreviewRepairedWearer struct {
UserID int64
OldDocumentID int64
NewDocumentID int64
}
type TelesrvRepairedCollectibleWearer struct {
UserID int64
OldDocumentID int64
NewDocumentID int64
}
type TempAuthKeyBinding struct {
TempAuthKeyID int64
PermAuthKeyID int64
@ -1564,6 +2153,66 @@ type ThemeUserInstall struct {
InstalledAt pgtype.Timestamptz
}
type TonBalance struct {
UserID int64
BalanceNanoton int64
Granted bool
UpdatedAt pgtype.Timestamptz
}
type TonTransaction struct {
ID int64
UserID int64
AmountNanoton int64
Reason string
PeerType *string
PeerID *int64
GiftID *int64
Date int32
}
type UniqueStarGift struct {
ID int64
GiftID int64
CollectibleRevisionID int64
SourceSavedGiftID int64
Title string
Slug string
Num int32
OwnerPeerType *string
OwnerPeerID *int64
ModelAttributeID int64
PatternAttributeID int64
BackdropAttributeID int64
KeepOriginalDetails bool
CreatedAt pgtype.Timestamptz
UpdatedAt pgtype.Timestamptz
RequirePremium bool
ResaleTonOnly bool
ThemeAvailable bool
Burned bool
Crafted bool
OriginalOwnerPeerType string
OriginalOwnerPeerID int64
OwnerName string
OwnerAddress string
GiftAddress string
ReleasedByPeerType *string
ReleasedByPeerID *int64
ValueAmount int64
ValueCurrency string
ValueUsdAmount int64
ThemePeerType *string
ThemePeerID *int64
HostPeerType *string
HostPeerID *int64
OfferMinStars int32
CraftChancePermille int32
LastSaleDate int32
LastSaleCurrency string
LastSaleAmount int64
}
type UpdateState struct {
AuthKeyID int64
Pts int32
@ -1627,6 +2276,13 @@ type User struct {
BirthdayMonth int32
BirthdayYear int32
PersonalChannelID int64
DeletedAt pgtype.Timestamptz
DeletionSource string
DeletionReason string
AccountDeleteAt pgtype.Timestamptz
EmojiStatusCollectibleID *int64
EmojiStatusCollectible []byte
LinkedCommunityID int64
SignupEmail string
}
@ -1703,33 +2359,34 @@ type UserTopReaction struct {
}
type UserUpdateEvent struct {
UserID int64
Pts int32
PtsCount int32
Date int32
EventType string
MessageBoxID *int32
PeerType *string
PeerID *int64
MaxID int32
StillUnreadCount int32
CreatedAt pgtype.Timestamptz
EventBool bool
EventPeers []byte
PeerSettings []byte
MessageIds []byte
DialogFilter []byte
FilterOrder []byte
FolderPeers []byte
FilterID int32
TagsEnabled bool
ChannelPts int32
FolderID int32
QuickReplies []byte
QuickReplyMessage []byte
StoryPayload []byte
ReactionPayload []byte
EventPhone string
UserID int64
Pts int32
PtsCount int32
Date int32
EventType string
MessageBoxID *int32
PeerType *string
PeerID *int64
MaxID int32
StillUnreadCount int32
CreatedAt pgtype.Timestamptz
EventBool bool
EventPeers []byte
PeerSettings []byte
MessageIds []byte
DialogFilter []byte
FilterOrder []byte
FolderPeers []byte
FilterID int32
TagsEnabled bool
ChannelPts int32
FolderID int32
QuickReplies []byte
QuickReplyMessage []byte
StoryPayload []byte
ReactionPayload []byte
EventPhone string
EmojiStatusPayload []byte
}
type UserUpdateRetention struct {
@ -1765,13 +2422,17 @@ type WebviewCustomMethodQuery struct {
}
type WebviewRequestedButton struct {
WebappReqID string
BotUserID int64
UserID int64
ButtonID int32
Text string
PeerType string
MaxQuantity int32
CreatedAt pgtype.Timestamptz
ExpiresAt pgtype.Timestamptz
WebappReqID string
BotUserID int64
UserID int64
ButtonID int32
Text string
PeerType string
MaxQuantity int32
CreatedAt pgtype.Timestamptz
ExpiresAt pgtype.Timestamptz
PeerFilter []byte
NameRequested bool
UsernameRequested bool
PhotoRequested bool
}

View file

@ -14,7 +14,7 @@ import (
const createUser = `-- name: CreateUser :one
INSERT INTO users (access_hash, phone, signup_email, first_name, last_name, username, country_code, premium_expires_at)
VALUES ($1, $2, $3, $4, $5, $6, $7, $8)
RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, signup_email
RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, signup_email
`
type CreateUserParams struct {
@ -70,13 +70,20 @@ func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, e
&i.BirthdayMonth,
&i.BirthdayYear,
&i.PersonalChannelID,
&i.DeletedAt,
&i.DeletionSource,
&i.DeletionReason,
&i.AccountDeleteAt,
&i.EmojiStatusCollectibleID,
&i.EmojiStatusCollectible,
&i.LinkedCommunityID,
&i.SignupEmail,
)
return i, err
}
const getUserByID = `-- name: GetUserByID :one
SELECT id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, signup_email FROM users WHERE id = $1
SELECT id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, signup_email FROM users WHERE id = $1
`
func (q *Queries) GetUserByID(ctx context.Context, id int64) (User, error) {
@ -112,13 +119,20 @@ func (q *Queries) GetUserByID(ctx context.Context, id int64) (User, error) {
&i.BirthdayMonth,
&i.BirthdayYear,
&i.PersonalChannelID,
&i.DeletedAt,
&i.DeletionSource,
&i.DeletionReason,
&i.AccountDeleteAt,
&i.EmojiStatusCollectibleID,
&i.EmojiStatusCollectible,
&i.LinkedCommunityID,
&i.SignupEmail,
)
return i, err
}
const getUserByPhone = `-- name: GetUserByPhone :one
SELECT id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, signup_email FROM users WHERE phone = $1
SELECT id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, signup_email FROM users WHERE phone = $1 AND deleted_at IS NULL
`
func (q *Queries) GetUserByPhone(ctx context.Context, phone string) (User, error) {
@ -154,13 +168,20 @@ func (q *Queries) GetUserByPhone(ctx context.Context, phone string) (User, error
&i.BirthdayMonth,
&i.BirthdayYear,
&i.PersonalChannelID,
&i.DeletedAt,
&i.DeletionSource,
&i.DeletionReason,
&i.AccountDeleteAt,
&i.EmojiStatusCollectibleID,
&i.EmojiStatusCollectible,
&i.LinkedCommunityID,
&i.SignupEmail,
)
return i, err
}
const getUserBySignupEmail = `-- name: GetUserBySignupEmail :one
SELECT id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, signup_email FROM users WHERE lower(signup_email) = lower($1) AND signup_email <> ''
SELECT id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, signup_email FROM users WHERE lower(signup_email) = lower($1) AND signup_email <> ''
`
func (q *Queries) GetUserBySignupEmail(ctx context.Context, lower string) (User, error) {
@ -196,13 +217,20 @@ func (q *Queries) GetUserBySignupEmail(ctx context.Context, lower string) (User,
&i.BirthdayMonth,
&i.BirthdayYear,
&i.PersonalChannelID,
&i.DeletedAt,
&i.DeletionSource,
&i.DeletionReason,
&i.AccountDeleteAt,
&i.EmojiStatusCollectibleID,
&i.EmojiStatusCollectible,
&i.LinkedCommunityID,
&i.SignupEmail,
)
return i, err
}
const getUserByUsername = `-- name: GetUserByUsername :one
SELECT id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, signup_email FROM users WHERE lower(username) = lower($1) AND username <> ''
SELECT id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, signup_email FROM users WHERE lower(username) = lower($1) AND username <> '' AND deleted_at IS NULL
`
func (q *Queries) GetUserByUsername(ctx context.Context, lower string) (User, error) {
@ -238,13 +266,20 @@ func (q *Queries) GetUserByUsername(ctx context.Context, lower string) (User, er
&i.BirthdayMonth,
&i.BirthdayYear,
&i.PersonalChannelID,
&i.DeletedAt,
&i.DeletionSource,
&i.DeletionReason,
&i.AccountDeleteAt,
&i.EmojiStatusCollectibleID,
&i.EmojiStatusCollectible,
&i.LinkedCommunityID,
&i.SignupEmail,
)
return i, err
}
const getUsersByIDs = `-- name: GetUsersByIDs :many
SELECT id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, signup_email
SELECT id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, signup_email
FROM users
WHERE id = ANY($1::bigint[])
ORDER BY id
@ -289,6 +324,13 @@ func (q *Queries) GetUsersByIDs(ctx context.Context, ids []int64) ([]User, error
&i.BirthdayMonth,
&i.BirthdayYear,
&i.PersonalChannelID,
&i.DeletedAt,
&i.DeletionSource,
&i.DeletionReason,
&i.AccountDeleteAt,
&i.EmojiStatusCollectibleID,
&i.EmojiStatusCollectible,
&i.LinkedCommunityID,
&i.SignupEmail,
); err != nil {
return nil, err
@ -302,9 +344,9 @@ func (q *Queries) GetUsersByIDs(ctx context.Context, ids []int64) ([]User, error
}
const getUsersByPhones = `-- name: GetUsersByPhones :many
SELECT id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, signup_email
SELECT id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, signup_email
FROM users
WHERE phone = ANY($1::text[])
WHERE phone = ANY($1::text[]) AND deleted_at IS NULL
ORDER BY id
`
@ -347,6 +389,13 @@ func (q *Queries) GetUsersByPhones(ctx context.Context, phones []string) ([]User
&i.BirthdayMonth,
&i.BirthdayYear,
&i.PersonalChannelID,
&i.DeletedAt,
&i.DeletionSource,
&i.DeletionReason,
&i.AccountDeleteAt,
&i.EmojiStatusCollectibleID,
&i.EmojiStatusCollectible,
&i.LinkedCommunityID,
&i.SignupEmail,
); err != nil {
return nil, err
@ -377,12 +426,15 @@ WITH matched AS (
u.premium_expires_at,
u.emoji_status_document_id,
u.emoji_status_until,
u.emoji_status_collectible_id,
u.emoji_status_collectible,
u.color_set,
u.color,
u.color_background_emoji_id,
u.profile_color_set,
u.profile_color,
u.profile_color_background_emoji_id,
u.linked_community_id,
u.last_seen_at,
(c.contact_user_id IS NOT NULL)::boolean AS contact,
COALESCE(c.mutual, false)::boolean AS mutual,
@ -397,6 +449,7 @@ WITH matched AS (
FROM users u
LEFT JOIN contacts c ON c.user_id = $4::bigint AND c.contact_user_id = u.id
WHERE u.id <> $4::bigint
AND u.deleted_at IS NULL
AND $3::text <> ''
AND (
($2::text <> '' AND u.phone LIKE $2::text || '%')
@ -425,12 +478,15 @@ SELECT
premium_expires_at,
emoji_status_document_id,
emoji_status_until,
emoji_status_collectible_id,
emoji_status_collectible,
color_set,
color,
color_background_emoji_id,
profile_color_set,
profile_color,
profile_color_background_emoji_id,
linked_community_id,
last_seen_at,
contact,
mutual
@ -463,12 +519,15 @@ type SearchUsersRow struct {
PremiumExpiresAt pgtype.Timestamptz
EmojiStatusDocumentID int64
EmojiStatusUntil int64
EmojiStatusCollectibleID *int64
EmojiStatusCollectible []byte
ColorSet bool
Color int32
ColorBackgroundEmojiID int64
ProfileColorSet bool
ProfileColor int32
ProfileColorBackgroundEmojiID int64
LinkedCommunityID int64
LastSeenAt int64
Contact bool
Mutual bool
@ -505,12 +564,15 @@ func (q *Queries) SearchUsers(ctx context.Context, arg SearchUsersParams) ([]Sea
&i.PremiumExpiresAt,
&i.EmojiStatusDocumentID,
&i.EmojiStatusUntil,
&i.EmojiStatusCollectibleID,
&i.EmojiStatusCollectible,
&i.ColorSet,
&i.Color,
&i.ColorBackgroundEmojiID,
&i.ProfileColorSet,
&i.ProfileColor,
&i.ProfileColorBackgroundEmojiID,
&i.LinkedCommunityID,
&i.LastSeenAt,
&i.Contact,
&i.Mutual,
@ -529,8 +591,8 @@ const setUserPremiumUntil = `-- name: SetUserPremiumUntil :one
UPDATE users
SET premium_expires_at = $1::timestamptz,
updated_at = now()
WHERE id = $2::bigint
RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, signup_email
WHERE id = $2::bigint AND deleted_at IS NULL
RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, signup_email
`
type SetUserPremiumUntilParams struct {
@ -571,6 +633,13 @@ func (q *Queries) SetUserPremiumUntil(ctx context.Context, arg SetUserPremiumUnt
&i.BirthdayMonth,
&i.BirthdayYear,
&i.PersonalChannelID,
&i.DeletedAt,
&i.DeletionSource,
&i.DeletionReason,
&i.AccountDeleteAt,
&i.EmojiStatusCollectibleID,
&i.EmojiStatusCollectible,
&i.LinkedCommunityID,
&i.SignupEmail,
)
return i, err
@ -580,8 +649,8 @@ const setUserVerified = `-- name: SetUserVerified :one
UPDATE users
SET verified = $1::boolean,
updated_at = now()
WHERE id = $2::bigint
RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, signup_email
WHERE id = $2::bigint AND deleted_at IS NULL
RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, signup_email
`
type SetUserVerifiedParams struct {
@ -622,6 +691,13 @@ func (q *Queries) SetUserVerified(ctx context.Context, arg SetUserVerifiedParams
&i.BirthdayMonth,
&i.BirthdayYear,
&i.PersonalChannelID,
&i.DeletedAt,
&i.DeletionSource,
&i.DeletionReason,
&i.AccountDeleteAt,
&i.EmojiStatusCollectibleID,
&i.EmojiStatusCollectible,
&i.LinkedCommunityID,
&i.SignupEmail,
)
return i, err
@ -634,11 +710,12 @@ SET premium_expires_at = NULL,
WHERE id IN (
SELECT id FROM users
WHERE premium_expires_at IS NOT NULL
AND deleted_at IS NULL
AND premium_expires_at <= $1::timestamptz
ORDER BY premium_expires_at
LIMIT $2::int
)
RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, signup_email
RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, signup_email
`
type SweepExpiredPremiumParams struct {
@ -685,6 +762,13 @@ func (q *Queries) SweepExpiredPremium(ctx context.Context, arg SweepExpiredPremi
&i.BirthdayMonth,
&i.BirthdayYear,
&i.PersonalChannelID,
&i.DeletedAt,
&i.DeletionSource,
&i.DeletionReason,
&i.AccountDeleteAt,
&i.EmojiStatusCollectibleID,
&i.EmojiStatusCollectible,
&i.LinkedCommunityID,
&i.SignupEmail,
); err != nil {
return nil, err
@ -703,8 +787,8 @@ SET birthday_day = $1::int,
birthday_month = $2::int,
birthday_year = $3::int,
updated_at = now()
WHERE id = $4::bigint
RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, signup_email
WHERE id = $4::bigint AND deleted_at IS NULL
RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, signup_email
`
type UpdateUserBirthdayParams struct {
@ -752,6 +836,13 @@ func (q *Queries) UpdateUserBirthday(ctx context.Context, arg UpdateUserBirthday
&i.BirthdayMonth,
&i.BirthdayYear,
&i.PersonalChannelID,
&i.DeletedAt,
&i.DeletionSource,
&i.DeletionReason,
&i.AccountDeleteAt,
&i.EmojiStatusCollectibleID,
&i.EmojiStatusCollectible,
&i.LinkedCommunityID,
&i.SignupEmail,
)
return i, err
@ -763,8 +854,8 @@ SET color_set = $1::boolean,
color = $2::int,
color_background_emoji_id = $3::bigint,
updated_at = now()
WHERE id = $4::bigint
RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, signup_email
WHERE id = $4::bigint AND deleted_at IS NULL
RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, signup_email
`
type UpdateUserColorParams struct {
@ -812,6 +903,13 @@ func (q *Queries) UpdateUserColor(ctx context.Context, arg UpdateUserColorParams
&i.BirthdayMonth,
&i.BirthdayYear,
&i.PersonalChannelID,
&i.DeletedAt,
&i.DeletionSource,
&i.DeletionReason,
&i.AccountDeleteAt,
&i.EmojiStatusCollectibleID,
&i.EmojiStatusCollectible,
&i.LinkedCommunityID,
&i.SignupEmail,
)
return i, err
@ -821,19 +919,29 @@ const updateUserEmojiStatus = `-- name: UpdateUserEmojiStatus :one
UPDATE users
SET emoji_status_document_id = $1::bigint,
emoji_status_until = $2::bigint,
emoji_status_collectible_id = $3::bigint,
emoji_status_collectible = $4::jsonb,
updated_at = now()
WHERE id = $3::bigint
RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, signup_email
WHERE id = $5::bigint AND deleted_at IS NULL
RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, signup_email
`
type UpdateUserEmojiStatusParams struct {
EmojiStatusDocumentID int64
EmojiStatusUntil int64
ID int64
EmojiStatusDocumentID int64
EmojiStatusUntil int64
EmojiStatusCollectibleID *int64
EmojiStatusCollectible []byte
ID int64
}
func (q *Queries) UpdateUserEmojiStatus(ctx context.Context, arg UpdateUserEmojiStatusParams) (User, error) {
row := q.db.QueryRow(ctx, updateUserEmojiStatus, arg.EmojiStatusDocumentID, arg.EmojiStatusUntil, arg.ID)
row := q.db.QueryRow(ctx, updateUserEmojiStatus,
arg.EmojiStatusDocumentID,
arg.EmojiStatusUntil,
arg.EmojiStatusCollectibleID,
arg.EmojiStatusCollectible,
arg.ID,
)
var i User
err := row.Scan(
&i.ID,
@ -865,6 +973,13 @@ func (q *Queries) UpdateUserEmojiStatus(ctx context.Context, arg UpdateUserEmoji
&i.BirthdayMonth,
&i.BirthdayYear,
&i.PersonalChannelID,
&i.DeletedAt,
&i.DeletionSource,
&i.DeletionReason,
&i.AccountDeleteAt,
&i.EmojiStatusCollectibleID,
&i.EmojiStatusCollectible,
&i.LinkedCommunityID,
&i.SignupEmail,
)
return i, err
@ -874,7 +989,7 @@ const updateUserLastSeen = `-- name: UpdateUserLastSeen :exec
UPDATE users
SET last_seen_at = GREATEST(last_seen_at, $1::bigint),
updated_at = now()
WHERE id = $2::bigint
WHERE id = $2::bigint AND deleted_at IS NULL
`
type UpdateUserLastSeenParams struct {
@ -891,8 +1006,8 @@ const updateUserPersonalChannel = `-- name: UpdateUserPersonalChannel :one
UPDATE users
SET personal_channel_id = $1::bigint,
updated_at = now()
WHERE id = $2::bigint
RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, signup_email
WHERE id = $2::bigint AND deleted_at IS NULL
RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, signup_email
`
type UpdateUserPersonalChannelParams struct {
@ -933,6 +1048,13 @@ func (q *Queries) UpdateUserPersonalChannel(ctx context.Context, arg UpdateUserP
&i.BirthdayMonth,
&i.BirthdayYear,
&i.PersonalChannelID,
&i.DeletedAt,
&i.DeletionSource,
&i.DeletionReason,
&i.AccountDeleteAt,
&i.EmojiStatusCollectibleID,
&i.EmojiStatusCollectible,
&i.LinkedCommunityID,
&i.SignupEmail,
)
return i, err
@ -942,8 +1064,8 @@ const updateUserPhone = `-- name: UpdateUserPhone :one
UPDATE users
SET phone = $1::text,
updated_at = now()
WHERE id = $2::bigint
RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, signup_email
WHERE id = $2::bigint AND deleted_at IS NULL
RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, signup_email
`
type UpdateUserPhoneParams struct {
@ -984,6 +1106,13 @@ func (q *Queries) UpdateUserPhone(ctx context.Context, arg UpdateUserPhoneParams
&i.BirthdayMonth,
&i.BirthdayYear,
&i.PersonalChannelID,
&i.DeletedAt,
&i.DeletionSource,
&i.DeletionReason,
&i.AccountDeleteAt,
&i.EmojiStatusCollectibleID,
&i.EmojiStatusCollectible,
&i.LinkedCommunityID,
&i.SignupEmail,
)
return i, err
@ -995,7 +1124,7 @@ SET phone = $1::text,
signup_email = $2::text,
updated_at = now()
WHERE id = $3::bigint
RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, signup_email
RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, signup_email
`
type UpdateUserPhoneAndSignupEmailParams struct {
@ -1037,6 +1166,13 @@ func (q *Queries) UpdateUserPhoneAndSignupEmail(ctx context.Context, arg UpdateU
&i.BirthdayMonth,
&i.BirthdayYear,
&i.PersonalChannelID,
&i.DeletedAt,
&i.DeletionSource,
&i.DeletionReason,
&i.AccountDeleteAt,
&i.EmojiStatusCollectibleID,
&i.EmojiStatusCollectible,
&i.LinkedCommunityID,
&i.SignupEmail,
)
return i, err
@ -1048,8 +1184,8 @@ SET first_name = $2,
last_name = $3,
about = $4,
updated_at = now()
WHERE id = $1
RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, signup_email
WHERE id = $1 AND deleted_at IS NULL
RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, signup_email
`
type UpdateUserProfileParams struct {
@ -1097,6 +1233,13 @@ func (q *Queries) UpdateUserProfile(ctx context.Context, arg UpdateUserProfilePa
&i.BirthdayMonth,
&i.BirthdayYear,
&i.PersonalChannelID,
&i.DeletedAt,
&i.DeletionSource,
&i.DeletionReason,
&i.AccountDeleteAt,
&i.EmojiStatusCollectibleID,
&i.EmojiStatusCollectible,
&i.LinkedCommunityID,
&i.SignupEmail,
)
return i, err
@ -1108,8 +1251,8 @@ SET profile_color_set = $1::boolean,
profile_color = $2::int,
profile_color_background_emoji_id = $3::bigint,
updated_at = now()
WHERE id = $4::bigint
RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, signup_email
WHERE id = $4::bigint AND deleted_at IS NULL
RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, signup_email
`
type UpdateUserProfileColorParams struct {
@ -1157,6 +1300,13 @@ func (q *Queries) UpdateUserProfileColor(ctx context.Context, arg UpdateUserProf
&i.BirthdayMonth,
&i.BirthdayYear,
&i.PersonalChannelID,
&i.DeletedAt,
&i.DeletionSource,
&i.DeletionReason,
&i.AccountDeleteAt,
&i.EmojiStatusCollectibleID,
&i.EmojiStatusCollectible,
&i.LinkedCommunityID,
&i.SignupEmail,
)
return i, err
@ -1166,8 +1316,8 @@ const updateUserUsername = `-- name: UpdateUserUsername :one
UPDATE users
SET username = $2,
updated_at = now()
WHERE id = $1
RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, signup_email
WHERE id = $1 AND deleted_at IS NULL
RETURNING id, access_hash, phone, first_name, last_name, username, country_code, created_at, updated_at, verified, support, about, last_seen_at, default_history_ttl_period, is_bot, bot_info_version, premium_expires_at, emoji_status_document_id, emoji_status_until, color_set, color, color_background_emoji_id, profile_color_set, profile_color, profile_color_background_emoji_id, birthday_day, birthday_month, birthday_year, personal_channel_id, deleted_at, deletion_source, deletion_reason, account_delete_at, emoji_status_collectible_id, emoji_status_collectible, linked_community_id, signup_email
`
type UpdateUserUsernameParams struct {
@ -1208,6 +1358,13 @@ func (q *Queries) UpdateUserUsername(ctx context.Context, arg UpdateUserUsername
&i.BirthdayMonth,
&i.BirthdayYear,
&i.PersonalChannelID,
&i.DeletedAt,
&i.DeletionSource,
&i.DeletionReason,
&i.AccountDeleteAt,
&i.EmojiStatusCollectibleID,
&i.EmojiStatusCollectible,
&i.LinkedCommunityID,
&i.SignupEmail,
)
return i, err

View file

@ -26,6 +26,7 @@ INSERT INTO user_update_events (
folder_peers,
story_payload,
reaction_payload,
emoji_status_payload,
message_box_id,
peer_type,
peer_id,
@ -51,43 +52,45 @@ INSERT INTO user_update_events (
$13::jsonb,
$14::jsonb,
$15::jsonb,
$16,
$17::text,
$18::bigint,
$19::int,
$16::jsonb,
$17,
$18::text,
$19::bigint,
$20::int,
$21::int,
$22::int,
$23::boolean,
$24::int
$23::int,
$24::boolean,
$25::int
)
`
type AppendUserUpdateEventParams struct {
UserID int64
Pts int32
PtsCount int32
Date int32
EventType string
EventBool bool
EventPhone string
EventPeers []byte
PeerSettings []byte
MessageIds []byte
DialogFilter []byte
FilterOrder []byte
FolderPeers []byte
StoryPayload []byte
ReactionPayload []byte
MessageBoxID *int32
PeerType *string
PeerID *int64
FilterID int32
MaxID int32
StillUnreadCount int32
ChannelPts int32
TagsEnabled bool
FolderID int32
UserID int64
Pts int32
PtsCount int32
Date int32
EventType string
EventBool bool
EventPhone string
EventPeers []byte
PeerSettings []byte
MessageIds []byte
DialogFilter []byte
FilterOrder []byte
FolderPeers []byte
StoryPayload []byte
ReactionPayload []byte
EmojiStatusPayload []byte
MessageBoxID *int32
PeerType *string
PeerID *int64
FilterID int32
MaxID int32
StillUnreadCount int32
ChannelPts int32
TagsEnabled bool
FolderID int32
}
func (q *Queries) AppendUserUpdateEvent(ctx context.Context, arg AppendUserUpdateEventParams) error {
@ -107,6 +110,7 @@ func (q *Queries) AppendUserUpdateEvent(ctx context.Context, arg AppendUserUpdat
arg.FolderPeers,
arg.StoryPayload,
arg.ReactionPayload,
arg.EmojiStatusPayload,
arg.MessageBoxID,
arg.PeerType,
arg.PeerID,
@ -137,6 +141,7 @@ SELECT
COALESCE(e.folder_peers::text, '[]')::text AS folder_peers_json,
COALESCE(e.story_payload::text, '{}')::text AS story_payload_json,
COALESCE(e.reaction_payload::text, '{}')::text AS reaction_payload_json,
COALESCE(e.emoji_status_payload::text, '{}')::text AS emoji_status_payload_json,
COALESCE(e.peer_type, '')::text AS event_peer_type,
COALESCE(e.peer_id, 0)::bigint AS event_peer_id,
e.filter_id,
@ -274,6 +279,7 @@ type BatchListDispatchEventsRow struct {
FolderPeersJson string
StoryPayloadJson string
ReactionPayloadJson string
EmojiStatusPayloadJson string
EventPeerType string
EventPeerID int64
FilterID int32
@ -409,6 +415,7 @@ func (q *Queries) BatchListDispatchEvents(ctx context.Context, arg BatchListDisp
&i.FolderPeersJson,
&i.StoryPayloadJson,
&i.ReactionPayloadJson,
&i.EmojiStatusPayloadJson,
&i.EventPeerType,
&i.EventPeerID,
&i.FilterID,
@ -788,6 +795,7 @@ SELECT
COALESCE(e.folder_peers::text, '[]')::text AS folder_peers_json,
COALESCE(e.story_payload::text, '{}')::text AS story_payload_json,
COALESCE(e.reaction_payload::text, '{}')::text AS reaction_payload_json,
COALESCE(e.emoji_status_payload::text, '{}')::text AS emoji_status_payload_json,
COALESCE(e.peer_type, '')::text AS event_peer_type,
COALESCE(e.peer_id, 0)::bigint AS event_peer_id,
e.filter_id,
@ -928,6 +936,7 @@ type ListUserUpdateEventsAfterRow struct {
FolderPeersJson string
StoryPayloadJson string
ReactionPayloadJson string
EmojiStatusPayloadJson string
EventPeerType string
EventPeerID int64
FilterID int32
@ -1061,6 +1070,7 @@ func (q *Queries) ListUserUpdateEventsAfter(ctx context.Context, arg ListUserUpd
&i.FolderPeersJson,
&i.StoryPayloadJson,
&i.ReactionPayloadJson,
&i.EmojiStatusPayloadJson,
&i.EventPeerType,
&i.EventPeerID,
&i.FilterID,