mirror of
https://github.com/J3vb/OwnCord.git
synced 2026-09-03 03:50:00 +03:00
Each verified: the generated dbgen method's only references were the .sql definition and dbgen output itself (no wrapper in db/*.go, no test, no script). ArchiveChannel, DeleteAttachment, FindExistingDMChannel, GetDefaultRole, GetMessagesByChannel, GetMessagesByChannelBeforeCursor, GetMessagesForAPIBeforeCursor, GetPinnedMessageRows, GetPlugin, GetPluginByName, InsertDMChannel, InsertDMOpenState, InsertDMParticipants, LinkAttachmentToMessage, SetChannelMixingThreshold, SetChannelVoiceMaxVideo, SetChannelVoiceQuality, UpdateVoiceSpeaking. dbgen regenerated with the pinned sqlc v1.30.0 (132 → 114 queries); sqlc-verify clean; db/service/ws suites green including -race. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
24 lines
717 B
SQL
24 lines
717 B
SQL
-- name: GetRoleByID :one
|
|
SELECT id, name, color, permissions, position, is_default
|
|
FROM roles WHERE id = ?;
|
|
|
|
-- name: ListRoles :many
|
|
SELECT id, name, color, permissions, position, is_default
|
|
FROM roles ORDER BY position DESC;
|
|
|
|
-- name: GetRoleForUser :one
|
|
SELECT r.id, r.name, r.color, r.permissions, r.position, r.is_default
|
|
FROM users u
|
|
JOIN roles r ON u.role_id = r.id
|
|
WHERE u.id = ?;
|
|
|
|
-- name: GetUserWithRole :one
|
|
SELECT u.id, u.username, u.password, u.avatar, u.role_id,
|
|
u.totp_secret, u.status, u.created_at, u.last_seen,
|
|
u.banned, u.ban_reason, u.ban_expires,
|
|
r.id, r.name, r.color, r.permissions, r.position, r.is_default
|
|
FROM users u
|
|
JOIN roles r ON r.id = u.role_id
|
|
WHERE u.id = ?;
|
|
|