From 174cb804943bc94b661db3af3ab26c13b319b498 Mon Sep 17 00:00:00 2001 From: Richard Hua Date: Wed, 28 Aug 2024 17:58:43 -0700 Subject: [PATCH] Re-generate queries, fix misnamed table --- .../mls/20240829001344_serial-ids.up.sql | 2 +- pkg/mls/store/queries/db.go | 2 +- pkg/mls/store/queries/models.go | 2 +- pkg/mls/store/queries/queries.sql.go | 20 +++++++++---------- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/pkg/migrations/mls/20240829001344_serial-ids.up.sql b/pkg/migrations/mls/20240829001344_serial-ids.up.sql index 359532ad..fe918d62 100644 --- a/pkg/migrations/mls/20240829001344_serial-ids.up.sql +++ b/pkg/migrations/mls/20240829001344_serial-ids.up.sql @@ -20,7 +20,7 @@ CREATE FUNCTION insert_welcome_message(installation_key BYTEA, data BYTEA, insta BEGIN PERFORM pg_advisory_xact_lock(hashtext('welcome_messages_sequence')); - RETURN QUERY INSERT INTO group_messages(installation_key, data, installation_key_data_hash, hpke_public_key) + RETURN QUERY INSERT INTO welcome_messages(installation_key, data, installation_key_data_hash, hpke_public_key) VALUES(installation_key, data, installation_key_data_hash, hpke_public_key) RETURNING *; diff --git a/pkg/mls/store/queries/db.go b/pkg/mls/store/queries/db.go index ef8b0c29..1cbab906 100644 --- a/pkg/mls/store/queries/db.go +++ b/pkg/mls/store/queries/db.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.25.0 +// sqlc v1.27.0 package queries diff --git a/pkg/mls/store/queries/models.go b/pkg/mls/store/queries/models.go index 3943a55a..0c6d61fb 100644 --- a/pkg/mls/store/queries/models.go +++ b/pkg/mls/store/queries/models.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.25.0 +// sqlc v1.27.0 package queries diff --git a/pkg/mls/store/queries/queries.sql.go b/pkg/mls/store/queries/queries.sql.go index 90b51b14..3bc6c86c 100644 --- a/pkg/mls/store/queries/queries.sql.go +++ b/pkg/mls/store/queries/queries.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.25.0 +// sqlc v1.27.0 // source: queries.sql package queries @@ -355,10 +355,10 @@ func (q *Queries) InsertAddressLog(ctx context.Context, arg InsertAddressLogPara } const insertGroupMessage = `-- name: InsertGroupMessage :one -INSERT INTO group_messages(group_id, data, group_id_data_hash) - VALUES ($1, $2, $3) -RETURNING +SELECT id, created_at, group_id, data, group_id_data_hash +FROM + insert_group_message($1, $2, $3) ` type InsertGroupMessageParams struct { @@ -381,10 +381,10 @@ func (q *Queries) InsertGroupMessage(ctx context.Context, arg InsertGroupMessage } const insertInboxLog = `-- name: InsertInboxLog :one -INSERT INTO inbox_log(inbox_id, server_timestamp_ns, identity_update_proto) - VALUES (decode($1, 'hex'), $2, $3) -RETURNING +SELECT sequence_id +FROM + insert_inbox_log(decode($1, 'hex'), $2, $3) ` type InsertInboxLogParams struct { @@ -401,10 +401,10 @@ func (q *Queries) InsertInboxLog(ctx context.Context, arg InsertInboxLogParams) } const insertWelcomeMessage = `-- name: InsertWelcomeMessage :one -INSERT INTO welcome_messages(installation_key, data, installation_key_data_hash, hpke_public_key) - VALUES ($1, $2, $3, $4) -RETURNING +SELECT id, created_at, installation_key, data, hpke_public_key, installation_key_data_hash +FROM + insert_welcome_message($1, $2, $3, $4) ` type InsertWelcomeMessageParams struct {