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>
26 lines
868 B
SQL
26 lines
868 B
SQL
-- name: InstallPlugin :execresult
|
|
INSERT INTO plugins (name, version, manifest_json) VALUES (?, ?, ?)
|
|
ON CONFLICT(name) DO UPDATE SET version = excluded.version, manifest_json = excluded.manifest_json;
|
|
|
|
-- name: EnablePlugin :exec
|
|
UPDATE plugins SET enabled = 1 WHERE id = ?;
|
|
|
|
-- name: DisablePlugin :exec
|
|
UPDATE plugins SET enabled = 0 WHERE id = ?;
|
|
|
|
-- name: UninstallPlugin :exec
|
|
DELETE FROM plugins WHERE id = ?;
|
|
|
|
-- name: ListPlugins :many
|
|
SELECT id, name, version, enabled, manifest_json, installed_at FROM plugins ORDER BY name;
|
|
|
|
-- name: PluginKVGet :one
|
|
SELECT value FROM plugin_kv WHERE plugin_id = ? AND key = ?;
|
|
|
|
-- name: PluginKVSet :exec
|
|
INSERT INTO plugin_kv (plugin_id, key, value) VALUES (?, ?, ?)
|
|
ON CONFLICT(plugin_id, key) DO UPDATE SET value = excluded.value;
|
|
|
|
-- name: PluginKVDelete :exec
|
|
DELETE FROM plugin_kv WHERE plugin_id = ? AND key = ?;
|