85 lines
1.8 KiB
Go
85 lines
1.8 KiB
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.26.0
|
|
// source: calls.sql
|
|
|
|
package database
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
const addCall = `-- name: AddCall :one
|
|
INSERT INTO calls (
|
|
id,
|
|
submitter,
|
|
system,
|
|
talkgroup,
|
|
call_date,
|
|
audio_name,
|
|
audio_blob,
|
|
audio_type,
|
|
audio_url,
|
|
frequency,
|
|
frequencies,
|
|
patches,
|
|
tg_label,
|
|
tg_tag,
|
|
tg_group,
|
|
source
|
|
) VALUES (gen_random_uuid(), $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15)
|
|
RETURNING id
|
|
`
|
|
|
|
type AddCallParams struct {
|
|
Submitter *int32 `json:"submitter"`
|
|
System int `json:"system"`
|
|
Talkgroup int `json:"talkgroup"`
|
|
CallDate time.Time `json:"call_date"`
|
|
AudioName *string `json:"audio_name"`
|
|
AudioBlob []byte `json:"audio_blob"`
|
|
AudioType *string `json:"audio_type"`
|
|
AudioUrl *string `json:"audio_url"`
|
|
Frequency int `json:"frequency"`
|
|
Frequencies []int `json:"frequencies"`
|
|
Patches []int `json:"patches"`
|
|
TgLabel *string `json:"tg_label"`
|
|
TgTag *string `json:"tg_tag"`
|
|
TgGroup *string `json:"tg_group"`
|
|
Source int `json:"source"`
|
|
}
|
|
|
|
func (q *Queries) AddCall(ctx context.Context, arg AddCallParams) (uuid.UUID, error) {
|
|
row := q.db.QueryRow(ctx, addCall,
|
|
arg.Submitter,
|
|
arg.System,
|
|
arg.Talkgroup,
|
|
arg.CallDate,
|
|
arg.AudioName,
|
|
arg.AudioBlob,
|
|
arg.AudioType,
|
|
arg.AudioUrl,
|
|
arg.Frequency,
|
|
arg.Frequencies,
|
|
arg.Patches,
|
|
arg.TgLabel,
|
|
arg.TgTag,
|
|
arg.TgGroup,
|
|
arg.Source,
|
|
)
|
|
var id uuid.UUID
|
|
err := row.Scan(&id)
|
|
return id, err
|
|
}
|
|
|
|
const setCallTranscript = `-- name: SetCallTranscript :exec
|
|
UPDATE calls SET transcript = $2 WHERE id = $1
|
|
`
|
|
|
|
func (q *Queries) SetCallTranscript(ctx context.Context, iD uuid.UUID, transcript *string) error {
|
|
_, err := q.db.Exec(ctx, setCallTranscript, iD, transcript)
|
|
return err
|
|
}
|