stillbox/pkg/gordio/database/calls.sql.go

100 lines
1.9 KiB
Go
Raw Normal View History

2024-07-16 19:31:30 -04:00
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.26.0
// source: calls.sql
package database
import (
"context"
"github.com/jackc/pgx/v5/pgtype"
)
const addCall = `-- name: AddCall :one
INSERT INTO calls (
id,
submitter,
system,
talkgroup,
2024-07-16 19:35:16 -04:00
call_date,
2024-07-16 19:31:30 -04:00
audio_name,
audio_blob,
audio_type,
audio_url,
frequency,
frequencies,
patches,
tg_label,
source
) VALUES (gen_random_uuid(), $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13)
2024-07-16 19:35:16 -04:00
RETURNING id, submitter, system, talkgroup, call_date, audio_name, audio_blob, audio_type, audio_url, frequency, frequencies, patches, tg_label, source, transcript
2024-07-16 19:31:30 -04:00
`
type AddCallParams struct {
Submitter pgtype.Int4
System int32
Talkgroup int32
2024-07-16 19:35:16 -04:00
CallDate pgtype.Timestamp
2024-07-16 19:31:30 -04:00
AudioName pgtype.Text
AudioBlob []byte
AudioType pgtype.Text
AudioUrl pgtype.Text
Frequency pgtype.Int4
Frequencies []byte
Patches []byte
TgLabel pgtype.Text
Source pgtype.Text
}
func (q *Queries) AddCall(ctx context.Context, arg AddCallParams) (Call, error) {
row := q.db.QueryRow(ctx, addCall,
arg.Submitter,
arg.System,
arg.Talkgroup,
2024-07-16 19:35:16 -04:00
arg.CallDate,
2024-07-16 19:31:30 -04:00
arg.AudioName,
arg.AudioBlob,
arg.AudioType,
arg.AudioUrl,
arg.Frequency,
arg.Frequencies,
arg.Patches,
arg.TgLabel,
arg.Source,
)
var i Call
err := row.Scan(
&i.ID,
&i.Submitter,
&i.System,
&i.Talkgroup,
2024-07-16 19:35:16 -04:00
&i.CallDate,
2024-07-16 19:31:30 -04:00
&i.AudioName,
&i.AudioBlob,
&i.AudioType,
&i.AudioUrl,
&i.Frequency,
&i.Frequencies,
&i.Patches,
&i.TgLabel,
&i.Source,
&i.Transcript,
)
return i, err
}
const updateCallTranscript = `-- name: UpdateCallTranscript :exec
UPDATE calls SET transcript = $2 WHERE id = $1
`
type UpdateCallTranscriptParams 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)
return err
}