From 82533fa7a583490ea9cebab48c4fc0cdeb3a02f8 Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Wed, 27 Nov 2024 21:29:09 +0200 Subject: Fixed sqlc codegen issues --- internal/data/frequencies.sql.go | 10 +++++----- internal/data/networks.sql.go | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'internal/data') diff --git a/internal/data/frequencies.sql.go b/internal/data/frequencies.sql.go index 3782309..7460e01 100644 --- a/internal/data/frequencies.sql.go +++ b/internal/data/frequencies.sql.go @@ -17,8 +17,8 @@ INSERT INTO frequencies ( name, hex_color, perms, position ) VALUES ( - ?, ?, ?, ?, ?, - (SELECT COUNT(*) FROM frequencies WHERE network_id = ?) + ?1, ?2, ?3, ?4, ?5, + (SELECT COUNT(*) FROM frequencies WHERE network_id = ?2) ) RETURNING id, network_id, name, hex_color, perms, position ` @@ -195,10 +195,10 @@ func (q *Queries) SetFrequencyPerms(ctx context.Context, arg SetFrequencyPermsPa const swapFrequencies = `-- name: SwapFrequencies :exec UPDATE frequencies SET position = CASE - WHEN position = ? THEN ? - WHEN position = ? THEN ? + WHEN position = ?1 THEN ?2 + WHEN position = ?2 THEN ?1 END -WHERE network_id = ? AND position IN (?, ?) +WHERE network_id = ?3 AND position IN (?1, ?2) ` type SwapFrequenciesParams struct { diff --git a/internal/data/networks.sql.go b/internal/data/networks.sql.go index 5e1e0db..70ee823 100644 --- a/internal/data/networks.sql.go +++ b/internal/data/networks.sql.go @@ -16,7 +16,7 @@ INSERT INTO networks ( id, owner_id, name, is_public, icon, bg_hex_color, fg_hex_color ) VALUES ( - ?, ?, ?, ?, + ?, ?, ?, ?, ?, ?, ? ) RETURNING id, owner_id, name, icon, bg_hex_color, fg_hex_color, is_public @@ -312,15 +312,15 @@ INSERT INTO users_networks ( is_member, is_admin, is_muted, is_banned, ban_reason ) VALUES ( - ?, ?, - ?, ?, ?, - ?, ? + ?1, ?2, + ?3, ?4, ?5, + ?6, ?7 ) ON CONFLICT DO UPDATE SET - is_member = ?, is_admin = ?, is_muted = ?, - is_banned = ?, ban_reason = ? -WHERE user_id = ? AND network_id = ? + is_member = ?3, is_admin = ?4, is_muted = ?5, + is_banned = ?6, ban_reason = ?7 +WHERE user_id = ?1 AND network_id = ?2 RETURNING user_id, network_id, joined_at, is_member, is_admin, is_muted, is_banned, ban_reason ` -- cgit v1.3.1