Files
OwnCord/Server/db/dbgen/models.go
T
J3vb 9116a880a3 feat(phase-bc): pass 5 — pgdbgen, postgres EventStore/PluginStore, plugin hub wiring, OTel stack, reconnect DB tier
- Generate Server/db/dbgen/{events,plugins}.sql.go and full Server/db/pgdbgen/ (//go:build postgres gated)
- Implement PostgresStore EventStore and PluginStore methods in store/postgres.go
- Wire plugin host_events.go EventSink into hub broadcast path (SetPluginEventSink)
- Wire host_commands.go slash-command dispatcher: chat_command V1 handler + hub.SetPluginRegistry
- Add handlers_command.go + handlers_command_test.go for plugin slash-command dispatch
- Add reconnect_db_test.go: TestReconnect_BufferMiss_FallsBackToDBTier (cold-tier DB replay)
- Add otel-up/otel-down Makefile targets; docker-compose.otel.yml + prometheus.dev.yml
- Update PHASE_BC_LOCAL_TODO.md: mark in-session items complete; document remaining network-blocked steps
- Minor fixes: channel_handler access-control, router plugin handler wiring, service span instrumentation
2026-04-06 22:48:59 +02:00

220 lines
5.7 KiB
Go

// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.30.0
package dbgen
import (
"time"
)
type Attachment struct {
ID string `json:"id"`
MessageID *int64 `json:"messageId"`
Filename string `json:"filename"`
StoredAs string `json:"storedAs"`
MimeType string `json:"mimeType"`
Size int64 `json:"size"`
UploadedAt string `json:"uploadedAt"`
Width *int64 `json:"width"`
Height *int64 `json:"height"`
UploaderID *int64 `json:"uploaderId"`
}
type AuditLog struct {
ID int64 `json:"id"`
ActorID int64 `json:"actorId"`
Action string `json:"action"`
TargetType string `json:"targetType"`
TargetID int64 `json:"targetId"`
Detail string `json:"detail"`
CreatedAt string `json:"createdAt"`
}
type Channel struct {
ID int64 `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
Category *string `json:"category"`
Topic *string `json:"topic"`
Position int64 `json:"position"`
SlowMode int64 `json:"slowMode"`
Archived int64 `json:"archived"`
CreatedAt string `json:"createdAt"`
VoiceMaxUsers int64 `json:"voiceMaxUsers"`
VoiceQuality *string `json:"voiceQuality"`
MixingThreshold *int64 `json:"mixingThreshold"`
VoiceMaxVideo int64 `json:"voiceMaxVideo"`
}
type ChannelOverride struct {
ID int64 `json:"id"`
ChannelID int64 `json:"channelId"`
RoleID int64 `json:"roleId"`
Allow int64 `json:"allow"`
Deny int64 `json:"deny"`
}
type DmOpenState struct {
UserID int64 `json:"userId"`
ChannelID int64 `json:"channelId"`
OpenedAt string `json:"openedAt"`
}
type DmParticipant struct {
ChannelID int64 `json:"channelId"`
UserID int64 `json:"userId"`
}
type Emoji struct {
ID int64 `json:"id"`
Shortcode string `json:"shortcode"`
Filename string `json:"filename"`
UploadedBy int64 `json:"uploadedBy"`
CreatedAt string `json:"createdAt"`
}
type Event struct {
Seq int64 `json:"seq"`
EventType string `json:"eventType"`
Payload []byte `json:"payload"`
ChannelID int64 `json:"channelId"`
CreatedAt time.Time `json:"createdAt"`
}
type Invite struct {
ID int64 `json:"id"`
Code string `json:"code"`
CreatedBy int64 `json:"createdBy"`
RedeemedBy *int64 `json:"redeemedBy"`
MaxUses *int64 `json:"maxUses"`
UseCount int64 `json:"useCount"`
ExpiresAt *string `json:"expiresAt"`
CreatedAt string `json:"createdAt"`
Revoked int64 `json:"revoked"`
}
type LoginAttempt struct {
ID int64 `json:"id"`
IpAddress string `json:"ipAddress"`
Username *string `json:"username"`
Success int64 `json:"success"`
Timestamp string `json:"timestamp"`
}
type Message struct {
ID int64 `json:"id"`
ChannelID int64 `json:"channelId"`
UserID int64 `json:"userId"`
Content string `json:"content"`
ReplyTo *int64 `json:"replyTo"`
EditedAt *string `json:"editedAt"`
Deleted int64 `json:"deleted"`
Pinned int64 `json:"pinned"`
Timestamp string `json:"timestamp"`
}
type MessagesFt struct {
Content string `json:"content"`
}
type Plugin struct {
ID int64 `json:"id"`
Name string `json:"name"`
Version string `json:"version"`
Enabled int64 `json:"enabled"`
ManifestJson string `json:"manifestJson"`
InstalledAt time.Time `json:"installedAt"`
}
type PluginKv struct {
PluginID int64 `json:"pluginId"`
Key string `json:"key"`
Value []byte `json:"value"`
}
type RateLockout struct {
Key string `json:"key"`
ExpiresAt string `json:"expiresAt"`
}
type Reaction struct {
ID int64 `json:"id"`
MessageID int64 `json:"messageId"`
UserID int64 `json:"userId"`
Emoji string `json:"emoji"`
}
type ReadState struct {
UserID int64 `json:"userId"`
ChannelID int64 `json:"channelId"`
LastMessageID int64 `json:"lastMessageId"`
MentionCount int64 `json:"mentionCount"`
}
type Role struct {
ID int64 `json:"id"`
Name string `json:"name"`
Color *string `json:"color"`
Permissions int64 `json:"permissions"`
Position int64 `json:"position"`
IsDefault int64 `json:"isDefault"`
}
type Session struct {
ID int64 `json:"id"`
UserID int64 `json:"userId"`
Token string `json:"token"`
Device *string `json:"device"`
IpAddress *string `json:"ipAddress"`
CreatedAt string `json:"createdAt"`
LastUsed string `json:"lastUsed"`
ExpiresAt string `json:"expiresAt"`
}
type Setting struct {
Key string `json:"key"`
Value string `json:"value"`
}
type Sound struct {
ID int64 `json:"id"`
Name string `json:"name"`
Filename string `json:"filename"`
DurationMs int64 `json:"durationMs"`
UploadedBy int64 `json:"uploadedBy"`
CreatedAt string `json:"createdAt"`
}
type User struct {
ID int64 `json:"id"`
Username string `json:"username"`
Password string `json:"password"`
Avatar *string `json:"avatar"`
RoleID int64 `json:"roleId"`
TotpSecret *string `json:"totpSecret"`
Status string `json:"status"`
CreatedAt string `json:"createdAt"`
LastSeen *string `json:"lastSeen"`
Banned int64 `json:"banned"`
BanReason *string `json:"banReason"`
BanExpires *string `json:"banExpires"`
}
type UserBlock struct {
BlockerID int64 `json:"blockerId"`
BlockedID int64 `json:"blockedId"`
CreatedAt string `json:"createdAt"`
}
type VoiceState struct {
UserID int64 `json:"userId"`
ChannelID int64 `json:"channelId"`
Muted int64 `json:"muted"`
Deafened int64 `json:"deafened"`
Speaking int64 `json:"speaking"`
JoinedAt string `json:"joinedAt"`
Camera int64 `json:"camera"`
Screenshare int64 `json:"screenshare"`
}