127 lines
2.8 KiB
Go
127 lines
2.8 KiB
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.29.0
|
|
// source: queries-file_properties.sql
|
|
|
|
package sqlc
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/jackc/pgx/v5/pgtype"
|
|
)
|
|
|
|
const getFileCapa = `-- name: GetFileCapa :one
|
|
SELECT id, file_id, data, type, created FROM capa_results
|
|
WHERE file_id = $1
|
|
`
|
|
|
|
func (q *Queries) GetFileCapa(ctx context.Context, fileID pgtype.UUID) (CapaResult, error) {
|
|
row := q.db.QueryRow(ctx, getFileCapa, fileID)
|
|
var i CapaResult
|
|
err := row.Scan(
|
|
&i.ID,
|
|
&i.FileID,
|
|
&i.Data,
|
|
&i.Type,
|
|
&i.Created,
|
|
)
|
|
return i, err
|
|
}
|
|
|
|
const getFileDIEC = `-- name: GetFileDIEC :one
|
|
SELECT id, file_id, data, created FROM diec
|
|
WHERE file_id = $1
|
|
`
|
|
|
|
func (q *Queries) GetFileDIEC(ctx context.Context, fileID pgtype.UUID) (Diec, error) {
|
|
row := q.db.QueryRow(ctx, getFileDIEC, fileID)
|
|
var i Diec
|
|
err := row.Scan(
|
|
&i.ID,
|
|
&i.FileID,
|
|
&i.Data,
|
|
&i.Created,
|
|
)
|
|
return i, err
|
|
}
|
|
|
|
const getFileProperties = `-- name: GetFileProperties :one
|
|
SELECT id, file_id, sha256, md5, libmagic_mime, libmagic_extension, libmagic_apple, created FROM file_properties
|
|
WHERE file_id = $1
|
|
`
|
|
|
|
func (q *Queries) GetFileProperties(ctx context.Context, fileID pgtype.UUID) (FileProperty, error) {
|
|
row := q.db.QueryRow(ctx, getFileProperties, fileID)
|
|
var i FileProperty
|
|
err := row.Scan(
|
|
&i.ID,
|
|
&i.FileID,
|
|
&i.Sha256,
|
|
&i.Md5,
|
|
&i.LibmagicMime,
|
|
&i.LibmagicExtension,
|
|
&i.LibmagicApple,
|
|
&i.Created,
|
|
)
|
|
return i, err
|
|
}
|
|
|
|
const insertFileCapa = `-- name: InsertFileCapa :exec
|
|
INSERT INTO capa_results (
|
|
file_id, data
|
|
) VALUES ($1, $2)
|
|
`
|
|
|
|
type InsertFileCapaParams struct {
|
|
FileID pgtype.UUID
|
|
Data []byte
|
|
}
|
|
|
|
func (q *Queries) InsertFileCapa(ctx context.Context, arg InsertFileCapaParams) error {
|
|
_, err := q.db.Exec(ctx, insertFileCapa, arg.FileID, arg.Data)
|
|
return err
|
|
}
|
|
|
|
const insertFileDIEC = `-- name: InsertFileDIEC :exec
|
|
INSERT INTO diec (
|
|
file_id, data
|
|
) VALUES ($1, $2)
|
|
`
|
|
|
|
type InsertFileDIECParams struct {
|
|
FileID pgtype.UUID
|
|
Data []byte
|
|
}
|
|
|
|
func (q *Queries) InsertFileDIEC(ctx context.Context, arg InsertFileDIECParams) error {
|
|
_, err := q.db.Exec(ctx, insertFileDIEC, arg.FileID, arg.Data)
|
|
return err
|
|
}
|
|
|
|
const insertFileProperties = `-- name: InsertFileProperties :exec
|
|
INSERT INTO file_properties (
|
|
file_id, sha256, md5, libmagic_mime, libmagic_extension, libmagic_apple
|
|
) VALUES ($1, $2, $3, $4, $5, $6)
|
|
`
|
|
|
|
type InsertFilePropertiesParams struct {
|
|
FileID pgtype.UUID
|
|
Sha256 []byte
|
|
Md5 []byte
|
|
LibmagicMime pgtype.Text
|
|
LibmagicExtension pgtype.Text
|
|
LibmagicApple pgtype.Text
|
|
}
|
|
|
|
func (q *Queries) InsertFileProperties(ctx context.Context, arg InsertFilePropertiesParams) error {
|
|
_, err := q.db.Exec(ctx, insertFileProperties,
|
|
arg.FileID,
|
|
arg.Sha256,
|
|
arg.Md5,
|
|
arg.LibmagicMime,
|
|
arg.LibmagicExtension,
|
|
arg.LibmagicApple,
|
|
)
|
|
return err
|
|
}
|