54 lines
1.2 KiB
Go
54 lines
1.2 KiB
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.29.0
|
|
// source: queries-yara.sql
|
|
|
|
package sqlc
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/jackc/pgx/v5/pgtype"
|
|
)
|
|
|
|
const deleteYaraResults = `-- name: DeleteYaraResults :exec
|
|
DELETE FROM yara_results
|
|
WHERE id = $1
|
|
`
|
|
|
|
func (q *Queries) DeleteYaraResults(ctx context.Context, id int64) error {
|
|
_, err := q.db.Exec(ctx, deleteYaraResults, id)
|
|
return err
|
|
}
|
|
|
|
const getYaraResults = `-- name: GetYaraResults :one
|
|
SELECT id, file_id, matched FROM yara_results
|
|
WHERE file_id = $1
|
|
LIMIT 1
|
|
`
|
|
|
|
func (q *Queries) GetYaraResults(ctx context.Context, fileID pgtype.UUID) (YaraResult, error) {
|
|
row := q.db.QueryRow(ctx, getYaraResults, fileID)
|
|
var i YaraResult
|
|
err := row.Scan(&i.ID, &i.FileID, &i.Matched)
|
|
return i, err
|
|
}
|
|
|
|
const insertYaraResults = `-- name: InsertYaraResults :one
|
|
INSERT INTO yara_results (
|
|
file_id, matched
|
|
) VALUES ($1, $2)
|
|
RETURNING id, file_id, matched
|
|
`
|
|
|
|
type InsertYaraResultsParams struct {
|
|
FileID pgtype.UUID
|
|
Matched []string
|
|
}
|
|
|
|
func (q *Queries) InsertYaraResults(ctx context.Context, arg InsertYaraResultsParams) (YaraResult, error) {
|
|
row := q.db.QueryRow(ctx, insertYaraResults, arg.FileID, arg.Matched)
|
|
var i YaraResult
|
|
err := row.Scan(&i.ID, &i.FileID, &i.Matched)
|
|
return i, err
|
|
}
|