75 lines
1.7 KiB
Go
75 lines
1.7 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 getFileProperties = `-- name: GetFileProperties :one
|
|
SELECT id, file_id, sha256, md5, libmagic_mime, libmagic_extension, libmagic_apple 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,
|
|
)
|
|
return i, 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
|
|
}
|