730f3ba11a
support folder paths * support folder paths * s3 storage docs
524 lines
14 KiB
Go
524 lines
14 KiB
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.27.0
|
|
|
|
package repository
|
|
|
|
import (
|
|
"database/sql/driver"
|
|
"fmt"
|
|
|
|
"github.com/google/uuid"
|
|
"github.com/jackc/pgx/v5/pgtype"
|
|
)
|
|
|
|
type BatchStatus string
|
|
|
|
const (
|
|
BatchStatusProcessing BatchStatus = "processing"
|
|
BatchStatusCompleted BatchStatus = "completed"
|
|
BatchStatusFailed BatchStatus = "failed"
|
|
BatchStatusCancelled BatchStatus = "cancelled"
|
|
)
|
|
|
|
func (e *BatchStatus) Scan(src interface{}) error {
|
|
switch s := src.(type) {
|
|
case []byte:
|
|
*e = BatchStatus(s)
|
|
case string:
|
|
*e = BatchStatus(s)
|
|
default:
|
|
return fmt.Errorf("unsupported scan type for BatchStatus: %T", src)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type NullBatchStatus struct {
|
|
BatchStatus BatchStatus
|
|
Valid bool // Valid is true if BatchStatus is not NULL
|
|
}
|
|
|
|
// Scan implements the Scanner interface.
|
|
func (ns *NullBatchStatus) Scan(value interface{}) error {
|
|
if value == nil {
|
|
ns.BatchStatus, ns.Valid = "", false
|
|
return nil
|
|
}
|
|
ns.Valid = true
|
|
return ns.BatchStatus.Scan(value)
|
|
}
|
|
|
|
// Value implements the driver Valuer interface.
|
|
func (ns NullBatchStatus) Value() (driver.Value, error) {
|
|
if !ns.Valid {
|
|
return nil, nil
|
|
}
|
|
return string(ns.BatchStatus), nil
|
|
}
|
|
|
|
func (e BatchStatus) Valid() bool {
|
|
switch e {
|
|
case BatchStatusProcessing,
|
|
BatchStatusCompleted,
|
|
BatchStatusFailed,
|
|
BatchStatusCancelled:
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
type Cleanfailtype string
|
|
|
|
const (
|
|
CleanfailtypeInvalidMimetype Cleanfailtype = "invalid_mimetype"
|
|
CleanfailtypeInvalidRead Cleanfailtype = "invalid_read"
|
|
CleanfailtypeInvalidReadPages Cleanfailtype = "invalid_read_pages"
|
|
CleanfailtypeZeroPageCount Cleanfailtype = "zero_page_count"
|
|
CleanfailtypeLargeFile Cleanfailtype = "large_file"
|
|
CleanfailtypeSmallDimensions Cleanfailtype = "small_dimensions"
|
|
CleanfailtypeLargeDimensions Cleanfailtype = "large_dimensions"
|
|
CleanfailtypeSmallDpi Cleanfailtype = "small_dpi"
|
|
CleanfailtypeLargeDpi Cleanfailtype = "large_dpi"
|
|
)
|
|
|
|
func (e *Cleanfailtype) Scan(src interface{}) error {
|
|
switch s := src.(type) {
|
|
case []byte:
|
|
*e = Cleanfailtype(s)
|
|
case string:
|
|
*e = Cleanfailtype(s)
|
|
default:
|
|
return fmt.Errorf("unsupported scan type for Cleanfailtype: %T", src)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type NullCleanfailtype struct {
|
|
Cleanfailtype Cleanfailtype
|
|
Valid bool // Valid is true if Cleanfailtype is not NULL
|
|
}
|
|
|
|
// Scan implements the Scanner interface.
|
|
func (ns *NullCleanfailtype) Scan(value interface{}) error {
|
|
if value == nil {
|
|
ns.Cleanfailtype, ns.Valid = "", false
|
|
return nil
|
|
}
|
|
ns.Valid = true
|
|
return ns.Cleanfailtype.Scan(value)
|
|
}
|
|
|
|
// Value implements the driver Valuer interface.
|
|
func (ns NullCleanfailtype) Value() (driver.Value, error) {
|
|
if !ns.Valid {
|
|
return nil, nil
|
|
}
|
|
return string(ns.Cleanfailtype), nil
|
|
}
|
|
|
|
func (e Cleanfailtype) Valid() bool {
|
|
switch e {
|
|
case CleanfailtypeInvalidMimetype,
|
|
CleanfailtypeInvalidRead,
|
|
CleanfailtypeInvalidReadPages,
|
|
CleanfailtypeZeroPageCount,
|
|
CleanfailtypeLargeFile,
|
|
CleanfailtypeSmallDimensions,
|
|
CleanfailtypeLargeDimensions,
|
|
CleanfailtypeSmallDpi,
|
|
CleanfailtypeLargeDpi:
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
type Cleanmimetype string
|
|
|
|
const (
|
|
CleanmimetypeApplicationPdf Cleanmimetype = "application/pdf"
|
|
)
|
|
|
|
func (e *Cleanmimetype) Scan(src interface{}) error {
|
|
switch s := src.(type) {
|
|
case []byte:
|
|
*e = Cleanmimetype(s)
|
|
case string:
|
|
*e = Cleanmimetype(s)
|
|
default:
|
|
return fmt.Errorf("unsupported scan type for Cleanmimetype: %T", src)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type NullCleanmimetype struct {
|
|
Cleanmimetype Cleanmimetype
|
|
Valid bool // Valid is true if Cleanmimetype is not NULL
|
|
}
|
|
|
|
// Scan implements the Scanner interface.
|
|
func (ns *NullCleanmimetype) Scan(value interface{}) error {
|
|
if value == nil {
|
|
ns.Cleanmimetype, ns.Valid = "", false
|
|
return nil
|
|
}
|
|
ns.Valid = true
|
|
return ns.Cleanmimetype.Scan(value)
|
|
}
|
|
|
|
// Value implements the driver Valuer interface.
|
|
func (ns NullCleanmimetype) Value() (driver.Value, error) {
|
|
if !ns.Valid {
|
|
return nil, nil
|
|
}
|
|
return string(ns.Cleanmimetype), nil
|
|
}
|
|
|
|
func (e Cleanmimetype) Valid() bool {
|
|
switch e {
|
|
case CleanmimetypeApplicationPdf:
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
type Querytype string
|
|
|
|
const (
|
|
QuerytypeContextFull Querytype = "context_full"
|
|
QuerytypeJsonExtractor Querytype = "json_extractor"
|
|
)
|
|
|
|
func (e *Querytype) Scan(src interface{}) error {
|
|
switch s := src.(type) {
|
|
case []byte:
|
|
*e = Querytype(s)
|
|
case string:
|
|
*e = Querytype(s)
|
|
default:
|
|
return fmt.Errorf("unsupported scan type for Querytype: %T", src)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type NullQuerytype struct {
|
|
Querytype Querytype
|
|
Valid bool // Valid is true if Querytype is not NULL
|
|
}
|
|
|
|
// Scan implements the Scanner interface.
|
|
func (ns *NullQuerytype) Scan(value interface{}) error {
|
|
if value == nil {
|
|
ns.Querytype, ns.Valid = "", false
|
|
return nil
|
|
}
|
|
ns.Valid = true
|
|
return ns.Querytype.Scan(value)
|
|
}
|
|
|
|
// Value implements the driver Valuer interface.
|
|
func (ns NullQuerytype) Value() (driver.Value, error) {
|
|
if !ns.Valid {
|
|
return nil, nil
|
|
}
|
|
return string(ns.Querytype), nil
|
|
}
|
|
|
|
func (e Querytype) Valid() bool {
|
|
switch e {
|
|
case QuerytypeContextFull,
|
|
QuerytypeJsonExtractor:
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
type BatchUpload struct {
|
|
ID uuid.UUID `db:"id"`
|
|
ClientID string `db:"client_id"`
|
|
OriginalFilename string `db:"original_filename"`
|
|
TotalDocuments int32 `db:"total_documents"`
|
|
ProcessedDocuments int32 `db:"processed_documents"`
|
|
FailedDocuments int32 `db:"failed_documents"`
|
|
InvalidTypeDocuments int32 `db:"invalid_type_documents"`
|
|
Status BatchStatus `db:"status"`
|
|
ProgressPercent int32 `db:"progress_percent"`
|
|
FailedFilenames []byte `db:"failed_filenames"`
|
|
CreatedAt pgtype.Timestamp `db:"created_at"`
|
|
CompletedAt pgtype.Timestamp `db:"completed_at"`
|
|
ArchiveBucket *string `db:"archive_bucket"`
|
|
ArchiveKey *string `db:"archive_key"`
|
|
FileSizeBytes *int64 `db:"file_size_bytes"`
|
|
}
|
|
|
|
type Client struct {
|
|
Clientid string `db:"clientid"`
|
|
Name string `db:"name"`
|
|
}
|
|
|
|
type Clientcansync struct {
|
|
Syncid uuid.UUID `db:"syncid"`
|
|
Clientid string `db:"clientid"`
|
|
Cansync bool `db:"cansync"`
|
|
}
|
|
|
|
type Collectoractiveversion struct {
|
|
ID uuid.UUID `db:"id"`
|
|
Clientid string `db:"clientid"`
|
|
Versionid int32 `db:"versionid"`
|
|
}
|
|
|
|
type Collectorcurrentactiveversion struct {
|
|
Clientid string `db:"clientid"`
|
|
Activeversion int32 `db:"activeversion"`
|
|
}
|
|
|
|
type Collectorlatestversion struct {
|
|
Clientid string `db:"clientid"`
|
|
Latestversion int32 `db:"latestversion"`
|
|
}
|
|
|
|
type Collectormincleanversion struct {
|
|
ID uuid.UUID `db:"id"`
|
|
Clientid string `db:"clientid"`
|
|
Versionid int64 `db:"versionid"`
|
|
Addedversion int32 `db:"addedversion"`
|
|
Removedversion *int32 `db:"removedversion"`
|
|
}
|
|
|
|
type Collectormintextversion struct {
|
|
ID uuid.UUID `db:"id"`
|
|
Clientid string `db:"clientid"`
|
|
Versionid int64 `db:"versionid"`
|
|
Addedversion int32 `db:"addedversion"`
|
|
Removedversion *int32 `db:"removedversion"`
|
|
}
|
|
|
|
type Collectorquery struct {
|
|
ID uuid.UUID `db:"id"`
|
|
Clientid string `db:"clientid"`
|
|
Name string `db:"name"`
|
|
Queryid uuid.UUID `db:"queryid"`
|
|
Addedversion int32 `db:"addedversion"`
|
|
Removedversion *int32 `db:"removedversion"`
|
|
}
|
|
|
|
type Collectorquerydependencytree struct {
|
|
Clientid string `db:"clientid"`
|
|
Queryid *uuid.UUID `db:"queryid"`
|
|
Querytype Querytype `db:"querytype"`
|
|
Queryversion int32 `db:"queryversion"`
|
|
Requiredids []uuid.UUID `db:"requiredids"`
|
|
}
|
|
|
|
type Collectorversion struct {
|
|
Clientid string `db:"clientid"`
|
|
ID int32 `db:"id"`
|
|
Addedat pgtype.Timestamp `db:"addedat"`
|
|
}
|
|
|
|
type Currentcleanentry struct {
|
|
ID uuid.UUID `db:"id"`
|
|
Documentid uuid.UUID `db:"documentid"`
|
|
Bucket *string `db:"bucket"`
|
|
Key *string `db:"key"`
|
|
Version int64 `db:"version"`
|
|
Hash *string `db:"hash"`
|
|
Mimetype NullCleanmimetype `db:"mimetype"`
|
|
Fail NullCleanfailtype `db:"fail"`
|
|
Clientid string `db:"clientid"`
|
|
}
|
|
|
|
type Currentclientcansync struct {
|
|
Clientid string `db:"clientid"`
|
|
Cansync bool `db:"cansync"`
|
|
}
|
|
|
|
type Currentcollectormincleanversion struct {
|
|
Clientid string `db:"clientid"`
|
|
Mincleanversion int64 `db:"mincleanversion"`
|
|
}
|
|
|
|
type Currentcollectormintextversion struct {
|
|
Clientid string `db:"clientid"`
|
|
Mintextversion int64 `db:"mintextversion"`
|
|
}
|
|
|
|
type Currentcollectorqueriesjsonagg struct {
|
|
Clientid string `db:"clientid"`
|
|
Fields []byte `db:"fields"`
|
|
}
|
|
|
|
type Currentcollectorquery struct {
|
|
Clientid string `db:"clientid"`
|
|
Name *string `db:"name"`
|
|
Queryid *uuid.UUID `db:"queryid"`
|
|
}
|
|
|
|
type Currenttextentry struct {
|
|
ID uuid.UUID `db:"id"`
|
|
Documentid uuid.UUID `db:"documentid"`
|
|
Bucket string `db:"bucket"`
|
|
Key string `db:"key"`
|
|
Hash string `db:"hash"`
|
|
Cleanid uuid.UUID `db:"cleanid"`
|
|
Extractionversion int64 `db:"extractionversion"`
|
|
}
|
|
|
|
type Document struct {
|
|
ID uuid.UUID `db:"id"`
|
|
Clientid string `db:"clientid"`
|
|
Hash string `db:"hash"`
|
|
BatchID *uuid.UUID `db:"batch_id"`
|
|
Filename *string `db:"filename"`
|
|
}
|
|
|
|
type Documentclean struct {
|
|
ID uuid.UUID `db:"id"`
|
|
Documentid uuid.UUID `db:"documentid"`
|
|
Bucket *string `db:"bucket"`
|
|
Key *string `db:"key"`
|
|
Hash *string `db:"hash"`
|
|
Mimetype NullCleanmimetype `db:"mimetype"`
|
|
Fail NullCleanfailtype `db:"fail"`
|
|
}
|
|
|
|
type Documentcleanentry struct {
|
|
ID uuid.UUID `db:"id"`
|
|
Cleanid uuid.UUID `db:"cleanid"`
|
|
Version int64 `db:"version"`
|
|
}
|
|
|
|
type Documententry struct {
|
|
ID uuid.UUID `db:"id"`
|
|
Documentid uuid.UUID `db:"documentid"`
|
|
Bucket string `db:"bucket"`
|
|
Key string `db:"key"`
|
|
}
|
|
|
|
type Documenttextextraction struct {
|
|
ID uuid.UUID `db:"id"`
|
|
Cleanid uuid.UUID `db:"cleanid"`
|
|
Bucket string `db:"bucket"`
|
|
Key string `db:"key"`
|
|
Hash string `db:"hash"`
|
|
Createdat pgtype.Timestamp `db:"createdat"`
|
|
Part uint16 `db:"part"`
|
|
}
|
|
|
|
type Documenttextextractionentry struct {
|
|
ID uuid.UUID `db:"id"`
|
|
Textid uuid.UUID `db:"textid"`
|
|
Version int64 `db:"version"`
|
|
}
|
|
|
|
type Documentupload struct {
|
|
ID uuid.UUID `db:"id"`
|
|
Bucket string `db:"bucket"`
|
|
Key string `db:"key"`
|
|
Clientid string `db:"clientid"`
|
|
Part uint16 `db:"part"`
|
|
Createdat pgtype.Timestamp `db:"createdat"`
|
|
Filename *string `db:"filename"`
|
|
BatchID *uuid.UUID `db:"batch_id"`
|
|
}
|
|
|
|
type Fullactivecollector struct {
|
|
Clientid string `db:"clientid"`
|
|
Mincleanversion int64 `db:"mincleanversion"`
|
|
Mintextversion int64 `db:"mintextversion"`
|
|
Activeversion int32 `db:"activeversion"`
|
|
Latestversion int32 `db:"latestversion"`
|
|
Fields []byte `db:"fields"`
|
|
}
|
|
|
|
type Fullactivequery struct {
|
|
Queryid uuid.UUID `db:"queryid"`
|
|
Querytype Querytype `db:"querytype"`
|
|
Activeversion int32 `db:"activeversion"`
|
|
Latestversion int32 `db:"latestversion"`
|
|
Config []byte `db:"config"`
|
|
Requiredids []uuid.UUID `db:"requiredids"`
|
|
}
|
|
|
|
type Fullclient struct {
|
|
Clientid string `db:"clientid"`
|
|
Name string `db:"name"`
|
|
Cansync bool `db:"cansync"`
|
|
}
|
|
|
|
type Query struct {
|
|
Queryid uuid.UUID `db:"queryid"`
|
|
Querytype Querytype `db:"querytype"`
|
|
}
|
|
|
|
type Queryactivedependency struct {
|
|
ID uuid.UUID `db:"id"`
|
|
Requiredqueryid *uuid.UUID `db:"requiredqueryid"`
|
|
}
|
|
|
|
type Queryactiveversion struct {
|
|
Activeversionentryid uuid.UUID `db:"activeversionentryid"`
|
|
Queryid uuid.UUID `db:"queryid"`
|
|
Versionid int32 `db:"versionid"`
|
|
}
|
|
|
|
type Queryconfig struct {
|
|
Configid uuid.UUID `db:"configid"`
|
|
Queryid uuid.UUID `db:"queryid"`
|
|
Config []byte `db:"config"`
|
|
Addedversion int32 `db:"addedversion"`
|
|
Removedversion *int32 `db:"removedversion"`
|
|
}
|
|
|
|
type Querycurrentactiveversion struct {
|
|
Queryid uuid.UUID `db:"queryid"`
|
|
Activeversion int32 `db:"activeversion"`
|
|
}
|
|
|
|
type Querycurrentconfig struct {
|
|
Queryid uuid.UUID `db:"queryid"`
|
|
Config []byte `db:"config"`
|
|
}
|
|
|
|
type Querycurrentrequiredid struct {
|
|
Queryid uuid.UUID `db:"queryid"`
|
|
Requiredqueryid *uuid.UUID `db:"requiredqueryid"`
|
|
}
|
|
|
|
type Querycurrentrequiredidsagg struct {
|
|
Queryid uuid.UUID `db:"queryid"`
|
|
Requiredids []uuid.UUID `db:"requiredids"`
|
|
}
|
|
|
|
type Querylatestversion struct {
|
|
Queryid uuid.UUID `db:"queryid"`
|
|
Latestversion int32 `db:"latestversion"`
|
|
}
|
|
|
|
type Queryversion struct {
|
|
Queryid uuid.UUID `db:"queryid"`
|
|
Versionid int32 `db:"versionid"`
|
|
Addedat pgtype.Timestamp `db:"addedat"`
|
|
}
|
|
|
|
type Requiredquery struct {
|
|
Requiredqueryentryid uuid.UUID `db:"requiredqueryentryid"`
|
|
Queryid uuid.UUID `db:"queryid"`
|
|
Requiredqueryid uuid.UUID `db:"requiredqueryid"`
|
|
Addedversion int32 `db:"addedversion"`
|
|
Removedversion *int32 `db:"removedversion"`
|
|
}
|
|
|
|
type Result struct {
|
|
ID uuid.UUID `db:"id"`
|
|
Textentryid uuid.UUID `db:"textentryid"`
|
|
Queryid uuid.UUID `db:"queryid"`
|
|
Value string `db:"value"`
|
|
Queryversion int32 `db:"queryversion"`
|
|
}
|
|
|
|
type Resultdependency struct {
|
|
Resultid uuid.UUID `db:"resultid"`
|
|
Requiredresultid uuid.UUID `db:"requiredresultid"`
|
|
}
|