Files
query-orchestration/internal/database/repository/models.go
T
Michael McGuinness f11f4def43 Merged in feature/clean (pull request #76)
Clean Set Up

* fail

* starteddb

* constraint

* cleantest

* fixqueries

* fixtests

* storemimetype

* buffer

* tests

* setup

* passingtests

* pdfHElloWorld

* rm

* test

* notodos

* tests

* clean

* testpdf
2025-02-28 13:11:53 +00:00

414 lines
10 KiB
Go

// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.27.0
package repository
import (
"database/sql/driver"
"fmt"
"github.com/jackc/pgx/v5/pgtype"
)
type Cleanfailtype string
const (
CleanfailtypeInvalidMimetype Cleanfailtype = "invalid_mimetype"
)
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:
return true
}
return false
}
type Cleanmimetypes string
const (
CleanmimetypesApplicationPdf Cleanmimetypes = "application/pdf"
)
func (e *Cleanmimetypes) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*e = Cleanmimetypes(s)
case string:
*e = Cleanmimetypes(s)
default:
return fmt.Errorf("unsupported scan type for Cleanmimetypes: %T", src)
}
return nil
}
type NullCleanmimetypes struct {
Cleanmimetypes Cleanmimetypes
Valid bool // Valid is true if Cleanmimetypes is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullCleanmimetypes) Scan(value interface{}) error {
if value == nil {
ns.Cleanmimetypes, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.Cleanmimetypes.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullCleanmimetypes) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.Cleanmimetypes), nil
}
func (e Cleanmimetypes) Valid() bool {
switch e {
case CleanmimetypesApplicationPdf:
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 Client struct {
ID pgtype.UUID `db:"id"`
Name string `db:"name"`
}
type Clientcansync struct {
ID pgtype.UUID `db:"id"`
Clientid pgtype.UUID `db:"clientid"`
Cansync bool `db:"cansync"`
}
type Collectoractiveversion struct {
ID pgtype.UUID `db:"id"`
Jobid pgtype.UUID `db:"jobid"`
Versionid int32 `db:"versionid"`
}
type Collectorcurrentactiveversion struct {
Jobid pgtype.UUID `db:"jobid"`
Activeversion int32 `db:"activeversion"`
}
type Collectorlatestversion struct {
Jobid pgtype.UUID `db:"jobid"`
Latestversion int32 `db:"latestversion"`
}
type Collectormincleanversion struct {
ID pgtype.UUID `db:"id"`
Jobid pgtype.UUID `db:"jobid"`
Versionid int32 `db:"versionid"`
Addedversion int32 `db:"addedversion"`
Removedversion *int32 `db:"removedversion"`
}
type Collectormintextversion struct {
ID pgtype.UUID `db:"id"`
Jobid pgtype.UUID `db:"jobid"`
Versionid int32 `db:"versionid"`
Addedversion int32 `db:"addedversion"`
Removedversion *int32 `db:"removedversion"`
}
type Collectorquery struct {
ID pgtype.UUID `db:"id"`
Jobid pgtype.UUID `db:"jobid"`
Name string `db:"name"`
Queryid pgtype.UUID `db:"queryid"`
Addedversion int32 `db:"addedversion"`
Removedversion *int32 `db:"removedversion"`
}
type Collectorquerydependencytree struct {
Jobid pgtype.UUID `db:"jobid"`
Queryid pgtype.UUID `db:"queryid"`
Type Querytype `db:"type"`
Queryversion int32 `db:"queryversion"`
Requiredids []pgtype.UUID `db:"requiredids"`
}
type Collectorversion struct {
Jobid pgtype.UUID `db:"jobid"`
ID int32 `db:"id"`
Addedat pgtype.Timestamp `db:"addedat"`
}
type Currentcleanentry struct {
ID pgtype.UUID `db:"id"`
Documentid pgtype.UUID `db:"documentid"`
Bucket *string `db:"bucket"`
Key *string `db:"key"`
Version int32 `db:"version"`
Mimetype NullCleanmimetypes `db:"mimetype"`
Fail NullCleanfailtype `db:"fail"`
}
type Currentclientcansync struct {
Clientid pgtype.UUID `db:"clientid"`
Cansync bool `db:"cansync"`
}
type Currentcollectormincleanversion struct {
Jobid pgtype.UUID `db:"jobid"`
Mincleanversion int32 `db:"mincleanversion"`
}
type Currentcollectormintextversion struct {
Jobid pgtype.UUID `db:"jobid"`
Mintextversion int32 `db:"mintextversion"`
}
type Currentcollectorqueriesjsonagg struct {
Jobid pgtype.UUID `db:"jobid"`
Fields []byte `db:"fields"`
}
type Currentcollectorquery struct {
Jobid pgtype.UUID `db:"jobid"`
Name *string `db:"name"`
Queryid pgtype.UUID `db:"queryid"`
}
type Currentjobcansync struct {
Jobid pgtype.UUID `db:"jobid"`
Cansync bool `db:"cansync"`
}
type Currenttextentry struct {
ID pgtype.UUID `db:"id"`
Documentid pgtype.UUID `db:"documentid"`
Bucket string `db:"bucket"`
Key string `db:"key"`
Version int32 `db:"version"`
Cleanentryid pgtype.UUID `db:"cleanentryid"`
}
type Document struct {
ID pgtype.UUID `db:"id"`
Jobid pgtype.UUID `db:"jobid"`
Hash string `db:"hash"`
}
type Documentclean struct {
ID pgtype.UUID `db:"id"`
Documentid pgtype.UUID `db:"documentid"`
Version int32 `db:"version"`
Bucket *string `db:"bucket"`
Key *string `db:"key"`
Mimetype NullCleanmimetypes `db:"mimetype"`
Fail NullCleanfailtype `db:"fail"`
}
type Documententry struct {
ID pgtype.UUID `db:"id"`
Documentid pgtype.UUID `db:"documentid"`
Bucket string `db:"bucket"`
Key string `db:"key"`
}
type Documenttextextraction struct {
ID pgtype.UUID `db:"id"`
Cleanentryid pgtype.UUID `db:"cleanentryid"`
Version int32 `db:"version"`
Bucket string `db:"bucket"`
Key string `db:"key"`
}
type Fullactivecollector struct {
Jobid pgtype.UUID `db:"jobid"`
Mincleanversion int32 `db:"mincleanversion"`
Mintextversion int32 `db:"mintextversion"`
Activeversion int32 `db:"activeversion"`
Latestversion int32 `db:"latestversion"`
Fields []byte `db:"fields"`
}
type Fullactivequery struct {
ID pgtype.UUID `db:"id"`
Type Querytype `db:"type"`
Activeversion int32 `db:"activeversion"`
Latestversion int32 `db:"latestversion"`
Config []byte `db:"config"`
Requiredids []pgtype.UUID `db:"requiredids"`
}
type Job struct {
ID pgtype.UUID `db:"id"`
Clientid pgtype.UUID `db:"clientid"`
}
type Jobcansync struct {
ID pgtype.UUID `db:"id"`
Jobid pgtype.UUID `db:"jobid"`
Cansync bool `db:"cansync"`
}
type Query struct {
ID pgtype.UUID `db:"id"`
Type Querytype `db:"type"`
}
type Queryactivedependency struct {
ID pgtype.UUID `db:"id"`
Requiredqueryid pgtype.UUID `db:"requiredqueryid"`
}
type Queryactiveversion struct {
ID pgtype.UUID `db:"id"`
Queryid pgtype.UUID `db:"queryid"`
Versionid int32 `db:"versionid"`
}
type Queryconfig struct {
ID pgtype.UUID `db:"id"`
Queryid pgtype.UUID `db:"queryid"`
Config []byte `db:"config"`
Addedversion int32 `db:"addedversion"`
Removedversion *int32 `db:"removedversion"`
}
type Querycurrentactiveversion struct {
Queryid pgtype.UUID `db:"queryid"`
Activeversion int32 `db:"activeversion"`
}
type Querycurrentconfig struct {
Queryid pgtype.UUID `db:"queryid"`
Config []byte `db:"config"`
}
type Querycurrentrequiredid struct {
Queryid pgtype.UUID `db:"queryid"`
Requiredqueryid pgtype.UUID `db:"requiredqueryid"`
}
type Querycurrentrequiredidsagg struct {
Queryid pgtype.UUID `db:"queryid"`
Requiredids []pgtype.UUID `db:"requiredids"`
}
type Querylatestversion struct {
Queryid pgtype.UUID `db:"queryid"`
Latestversion int32 `db:"latestversion"`
}
type Queryversion struct {
Queryid pgtype.UUID `db:"queryid"`
ID int32 `db:"id"`
Addedat pgtype.Timestamp `db:"addedat"`
}
type Requiredquery struct {
ID pgtype.UUID `db:"id"`
Queryid pgtype.UUID `db:"queryid"`
Requiredqueryid pgtype.UUID `db:"requiredqueryid"`
Addedversion int32 `db:"addedversion"`
Removedversion *int32 `db:"removedversion"`
}
type Result struct {
ID pgtype.UUID `db:"id"`
Textentryid pgtype.UUID `db:"textentryid"`
Queryid pgtype.UUID `db:"queryid"`
Value string `db:"value"`
Queryversion int32 `db:"queryversion"`
}
type Resultdependency struct {
Resultid pgtype.UUID `db:"resultid"`
Requiredresultid pgtype.UUID `db:"requiredresultid"`
}