From d7352ddb53e1143794bf3f244dfa33741ecdb75e Mon Sep 17 00:00:00 2001 From: Daniel Ponte Date: Wed, 17 Jul 2024 19:33:09 -0400 Subject: [PATCH] Set call transcript --- pkg/gordio/database/calls.sql.go | 8 ++++---- pkg/gordio/database/talkgroups.sql.go | 3 +-- sql/postgres/queries/calls.sql | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/pkg/gordio/database/calls.sql.go b/pkg/gordio/database/calls.sql.go index f7adab0..bba4313 100644 --- a/pkg/gordio/database/calls.sql.go +++ b/pkg/gordio/database/calls.sql.go @@ -84,16 +84,16 @@ func (q *Queries) AddCall(ctx context.Context, arg AddCallParams) (Call, error) return i, err } -const updateCallTranscript = `-- name: UpdateCallTranscript :exec +const setCallTranscript = `-- name: SetCallTranscript :exec UPDATE calls SET transcript = $2 WHERE id = $1 ` -type UpdateCallTranscriptParams struct { +type SetCallTranscriptParams struct { ID pgtype.UUID Transcript pgtype.Text } -func (q *Queries) UpdateCallTranscript(ctx context.Context, arg UpdateCallTranscriptParams) error { - _, err := q.db.Exec(ctx, updateCallTranscript, arg.ID, arg.Transcript) +func (q *Queries) SetCallTranscript(ctx context.Context, arg SetCallTranscriptParams) error { + _, err := q.db.Exec(ctx, setCallTranscript, arg.ID, arg.Transcript) return err } diff --git a/pkg/gordio/database/talkgroups.sql.go b/pkg/gordio/database/talkgroups.sql.go index 851046f..f8a3091 100644 --- a/pkg/gordio/database/talkgroups.sql.go +++ b/pkg/gordio/database/talkgroups.sql.go @@ -73,8 +73,7 @@ func (q *Queries) GetTalkgroupsWithAnyTags(ctx context.Context, tags []string) ( const setTalkgroupTags = `-- name: SetTalkgroupTags :exec INSERT INTO talkgroups_tags(talkgroup_id, tags) VALUES($1, $2) -ON CONFLICT (talkgroup_id) DO UPDATE -SET tags = $2 +ON CONFLICT (talkgroup_id) DO UPDATE SET tags = $2 ` type SetTalkgroupTagsParams struct { diff --git a/sql/postgres/queries/calls.sql b/sql/postgres/queries/calls.sql index 00694bb..f05f543 100644 --- a/sql/postgres/queries/calls.sql +++ b/sql/postgres/queries/calls.sql @@ -17,5 +17,5 @@ INSERT INTO calls ( ) VALUES (gen_random_uuid(), $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13) RETURNING *; --- name: UpdateCallTranscript :exec +-- name: SetCallTranscript :exec UPDATE calls SET transcript = $2 WHERE id = $1;