batchsqlc

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batch

type Batch struct {
	ID          uuid.UUID        `json:"id"`
	App         string           `json:"app"`
	Op          string           `json:"op"`
	Context     []byte           `json:"context"`
	Inputfile   pgtype.Text      `json:"inputfile"`
	Status      StatusEnum       `json:"status"`
	Reqat       pgtype.Timestamp `json:"reqat"`
	Doneat      pgtype.Timestamp `json:"doneat"`
	Outputfiles []byte           `json:"outputfiles"`
	Nsuccess    pgtype.Int4      `json:"nsuccess"`
	Nfailed     pgtype.Int4      `json:"nfailed"`
	Naborted    pgtype.Int4      `json:"naborted"`
}

type Batchrow

type Batchrow struct {
	Rowid    int32            `json:"rowid"`
	Batch    uuid.UUID        `json:"batch"`
	Line     int32            `json:"line"`
	Input    []byte           `json:"input"`
	Status   StatusEnum       `json:"status"`
	Reqat    pgtype.Timestamp `json:"reqat"`
	Doneat   pgtype.Timestamp `json:"doneat"`
	Res      []byte           `json:"res"`
	Blobrows []byte           `json:"blobrows"`
	Messages []byte           `json:"messages"`
	Doneby   pgtype.Text      `json:"doneby"`
}

type BulkInsertIntoBatchRowsParams

type BulkInsertIntoBatchRowsParams struct {
	Batch []uuid.UUID        `json:"batch"`
	Line  []int32            `json:"line"`
	Input [][]byte           `json:"input"`
	Reqat []pgtype.Timestamp `json:"reqat"`
}

type CountBatchRowsByBatchIDAndStatusParams

type CountBatchRowsByBatchIDAndStatusParams struct {
	Batch    uuid.UUID  `json:"batch"`
	Status   StatusEnum `json:"status"`
	Status_2 StatusEnum `json:"status_2"`
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type FetchBatchRowsForBatchDoneRow

type FetchBatchRowsForBatchDoneRow struct {
	Line     int32      `json:"line"`
	Status   StatusEnum `json:"status"`
	Res      []byte     `json:"res"`
	Messages []byte     `json:"messages"`
}

type FetchBlockOfRowsParams

type FetchBlockOfRowsParams struct {
	Status StatusEnum `json:"status"`
	Limit  int32      `json:"limit"`
}

type FetchBlockOfRowsRow

type FetchBlockOfRowsRow struct {
	App     string     `json:"app"`
	Status  StatusEnum `json:"status"`
	Op      string     `json:"op"`
	Context []byte     `json:"context"`
	Batch   uuid.UUID  `json:"batch"`
	Rowid   int32      `json:"rowid"`
	Line    int32      `json:"line"`
	Input   []byte     `json:"input"`
}

type GetBatchRowsByBatchIDSortedRow

type GetBatchRowsByBatchIDSortedRow struct {
	Rowid    int32            `json:"rowid"`
	Line     int32            `json:"line"`
	Input    []byte           `json:"input"`
	Status   StatusEnum       `json:"status"`
	Reqat    pgtype.Timestamp `json:"reqat"`
	Doneat   pgtype.Timestamp `json:"doneat"`
	Res      []byte           `json:"res"`
	Blobrows []byte           `json:"blobrows"`
	Messages []byte           `json:"messages"`
	Doneby   pgtype.Text      `json:"doneby"`
}

type GetPendingBatchRowsRow

type GetPendingBatchRowsRow struct {
	Rowid    int32            `json:"rowid"`
	Line     int32            `json:"line"`
	Input    []byte           `json:"input"`
	Status   StatusEnum       `json:"status"`
	Reqat    pgtype.Timestamp `json:"reqat"`
	Doneat   pgtype.Timestamp `json:"doneat"`
	Res      []byte           `json:"res"`
	Blobrows []byte           `json:"blobrows"`
	Messages []byte           `json:"messages"`
	Doneby   pgtype.Text      `json:"doneby"`
}

type GetProcessedBatchRowsByBatchIDSortedRow

type GetProcessedBatchRowsByBatchIDSortedRow struct {
	Rowid    int32            `json:"rowid"`
	Line     int32            `json:"line"`
	Input    []byte           `json:"input"`
	Status   StatusEnum       `json:"status"`
	Reqat    pgtype.Timestamp `json:"reqat"`
	Doneat   pgtype.Timestamp `json:"doneat"`
	Res      []byte           `json:"res"`
	Blobrows []byte           `json:"blobrows"`
	Messages []byte           `json:"messages"`
	Doneby   pgtype.Text      `json:"doneby"`
}

type InsertIntoBatchRowsParams

type InsertIntoBatchRowsParams struct {
	Batch uuid.UUID        `json:"batch"`
	Line  int32            `json:"line"`
	Input []byte           `json:"input"`
	Reqat pgtype.Timestamp `json:"reqat"`
}

type InsertIntoBatchesParams

type InsertIntoBatchesParams struct {
	ID      uuid.UUID        `json:"id"`
	App     string           `json:"app"`
	Op      string           `json:"op"`
	Context []byte           `json:"context"`
	Status  StatusEnum       `json:"status"`
	Reqat   pgtype.Timestamp `json:"reqat"`
}

type NullStatusEnum

type NullStatusEnum struct {
	StatusEnum StatusEnum `json:"status_enum"`
	Valid      bool       `json:"valid"` // Valid is true if StatusEnum is not NULL
}

func (*NullStatusEnum) Scan

func (ns *NullStatusEnum) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullStatusEnum) Value

func (ns NullStatusEnum) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Querier

type Querier interface {
	BulkInsertIntoBatchRows(ctx context.Context, arg BulkInsertIntoBatchRowsParams) (int64, error)
	CountBatchRowsByBatchIDAndStatus(ctx context.Context, arg CountBatchRowsByBatchIDAndStatusParams) (int64, error)
	FetchBatchRowsForBatchDone(ctx context.Context, batch uuid.UUID) ([]FetchBatchRowsForBatchDoneRow, error)
	FetchBlockOfRows(ctx context.Context, arg FetchBlockOfRowsParams) ([]FetchBlockOfRowsRow, error)
	GetBatchByID(ctx context.Context, id uuid.UUID) (Batch, error)
	GetBatchRowsByBatchID(ctx context.Context, batch uuid.UUID) ([]Batchrow, error)
	GetBatchRowsByBatchIDSorted(ctx context.Context, batch uuid.UUID) ([]GetBatchRowsByBatchIDSortedRow, error)
	GetBatchRowsCount(ctx context.Context, batch uuid.UUID) (int64, error)
	GetBatchStatus(ctx context.Context, id uuid.UUID) (StatusEnum, error)
	GetCompletedBatches(ctx context.Context) ([]uuid.UUID, error)
	GetPendingBatchRows(ctx context.Context, batch uuid.UUID) ([]GetPendingBatchRowsRow, error)
	GetProcessedBatchRowsByBatchIDSorted(ctx context.Context, batch uuid.UUID) ([]GetProcessedBatchRowsByBatchIDSortedRow, error)
	InsertIntoBatchRows(ctx context.Context, arg InsertIntoBatchRowsParams) error
	InsertIntoBatches(ctx context.Context, arg InsertIntoBatchesParams) (uuid.UUID, error)
	UpdateBatchCounters(ctx context.Context, arg UpdateBatchCountersParams) error
	UpdateBatchOutputFiles(ctx context.Context, arg UpdateBatchOutputFilesParams) error
	UpdateBatchRowStatus(ctx context.Context, arg UpdateBatchRowStatusParams) error
	UpdateBatchRowsBatchJob(ctx context.Context, arg UpdateBatchRowsBatchJobParams) error
	UpdateBatchRowsSlowQuery(ctx context.Context, arg UpdateBatchRowsSlowQueryParams) error
	UpdateBatchRowsStatus(ctx context.Context, arg UpdateBatchRowsStatusParams) error
	UpdateBatchStatus(ctx context.Context, arg UpdateBatchStatusParams) error
	UpdateBatchSummary(ctx context.Context, arg UpdateBatchSummaryParams) error
	UpdateBatchSummaryOnAbort(ctx context.Context, arg UpdateBatchSummaryOnAbortParams) error
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) BulkInsertIntoBatchRows

func (q *Queries) BulkInsertIntoBatchRows(ctx context.Context, arg BulkInsertIntoBatchRowsParams) (int64, error)

func (*Queries) CountBatchRowsByBatchIDAndStatus

func (q *Queries) CountBatchRowsByBatchIDAndStatus(ctx context.Context, arg CountBatchRowsByBatchIDAndStatusParams) (int64, error)

func (*Queries) FetchBatchRowsForBatchDone

func (q *Queries) FetchBatchRowsForBatchDone(ctx context.Context, batch uuid.UUID) ([]FetchBatchRowsForBatchDoneRow, error)

func (*Queries) FetchBlockOfRows

func (q *Queries) FetchBlockOfRows(ctx context.Context, arg FetchBlockOfRowsParams) ([]FetchBlockOfRowsRow, error)

func (*Queries) GetBatchByID

func (q *Queries) GetBatchByID(ctx context.Context, id uuid.UUID) (Batch, error)

func (*Queries) GetBatchRowsByBatchID

func (q *Queries) GetBatchRowsByBatchID(ctx context.Context, batch uuid.UUID) ([]Batchrow, error)

func (*Queries) GetBatchRowsByBatchIDSorted

func (q *Queries) GetBatchRowsByBatchIDSorted(ctx context.Context, batch uuid.UUID) ([]GetBatchRowsByBatchIDSortedRow, error)

func (*Queries) GetBatchRowsCount

func (q *Queries) GetBatchRowsCount(ctx context.Context, batch uuid.UUID) (int64, error)

func (*Queries) GetBatchStatus

func (q *Queries) GetBatchStatus(ctx context.Context, id uuid.UUID) (StatusEnum, error)

func (*Queries) GetCompletedBatches

func (q *Queries) GetCompletedBatches(ctx context.Context) ([]uuid.UUID, error)

func (*Queries) GetPendingBatchRows

func (q *Queries) GetPendingBatchRows(ctx context.Context, batch uuid.UUID) ([]GetPendingBatchRowsRow, error)

func (*Queries) GetProcessedBatchRowsByBatchIDSorted

func (q *Queries) GetProcessedBatchRowsByBatchIDSorted(ctx context.Context, batch uuid.UUID) ([]GetProcessedBatchRowsByBatchIDSortedRow, error)

func (*Queries) InsertIntoBatchRows

func (q *Queries) InsertIntoBatchRows(ctx context.Context, arg InsertIntoBatchRowsParams) error

func (*Queries) InsertIntoBatches

func (q *Queries) InsertIntoBatches(ctx context.Context, arg InsertIntoBatchesParams) (uuid.UUID, error)

func (*Queries) UpdateBatchCounters

func (q *Queries) UpdateBatchCounters(ctx context.Context, arg UpdateBatchCountersParams) error

func (*Queries) UpdateBatchOutputFiles

func (q *Queries) UpdateBatchOutputFiles(ctx context.Context, arg UpdateBatchOutputFilesParams) error

func (*Queries) UpdateBatchRowStatus

func (q *Queries) UpdateBatchRowStatus(ctx context.Context, arg UpdateBatchRowStatusParams) error

func (*Queries) UpdateBatchRowsBatchJob

func (q *Queries) UpdateBatchRowsBatchJob(ctx context.Context, arg UpdateBatchRowsBatchJobParams) error

func (*Queries) UpdateBatchRowsSlowQuery

func (q *Queries) UpdateBatchRowsSlowQuery(ctx context.Context, arg UpdateBatchRowsSlowQueryParams) error

func (*Queries) UpdateBatchRowsStatus

func (q *Queries) UpdateBatchRowsStatus(ctx context.Context, arg UpdateBatchRowsStatusParams) error

func (*Queries) UpdateBatchStatus

func (q *Queries) UpdateBatchStatus(ctx context.Context, arg UpdateBatchStatusParams) error

func (*Queries) UpdateBatchSummary

func (q *Queries) UpdateBatchSummary(ctx context.Context, arg UpdateBatchSummaryParams) error

func (*Queries) UpdateBatchSummaryOnAbort

func (q *Queries) UpdateBatchSummaryOnAbort(ctx context.Context, arg UpdateBatchSummaryOnAbortParams) error

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type StatusEnum

type StatusEnum string
const (
	StatusEnumQueued  StatusEnum = "queued"
	StatusEnumInprog  StatusEnum = "inprog"
	StatusEnumSuccess StatusEnum = "success"
	StatusEnumFailed  StatusEnum = "failed"
	StatusEnumAborted StatusEnum = "aborted"
	StatusEnumWait    StatusEnum = "wait"
)

func (*StatusEnum) Scan

func (e *StatusEnum) Scan(src interface{}) error

type UpdateBatchCountersParams

type UpdateBatchCountersParams struct {
	ID       uuid.UUID   `json:"id"`
	Nsuccess pgtype.Int4 `json:"nsuccess"`
	Nfailed  pgtype.Int4 `json:"nfailed"`
	Naborted pgtype.Int4 `json:"naborted"`
}

type UpdateBatchOutputFilesParams

type UpdateBatchOutputFilesParams struct {
	ID          uuid.UUID `json:"id"`
	Outputfiles []byte    `json:"outputfiles"`
}

type UpdateBatchRowStatusParams

type UpdateBatchRowStatusParams struct {
	Rowid  int32      `json:"rowid"`
	Status StatusEnum `json:"status"`
}

type UpdateBatchRowsBatchJobParams

type UpdateBatchRowsBatchJobParams struct {
	Rowid    int32            `json:"rowid"`
	Status   StatusEnum       `json:"status"`
	Doneat   pgtype.Timestamp `json:"doneat"`
	Res      []byte           `json:"res"`
	Blobrows []byte           `json:"blobrows"`
	Messages []byte           `json:"messages"`
	Doneby   pgtype.Text      `json:"doneby"`
}

type UpdateBatchRowsSlowQueryParams

type UpdateBatchRowsSlowQueryParams struct {
	Rowid    int32            `json:"rowid"`
	Status   StatusEnum       `json:"status"`
	Doneat   pgtype.Timestamp `json:"doneat"`
	Res      []byte           `json:"res"`
	Messages []byte           `json:"messages"`
	Doneby   pgtype.Text      `json:"doneby"`
}

type UpdateBatchRowsStatusParams

type UpdateBatchRowsStatusParams struct {
	Status  StatusEnum `json:"status"`
	Column2 []int32    `json:"column_2"`
}

type UpdateBatchStatusParams

type UpdateBatchStatusParams struct {
	ID          uuid.UUID        `json:"id"`
	Status      StatusEnum       `json:"status"`
	Doneat      pgtype.Timestamp `json:"doneat"`
	Outputfiles []byte           `json:"outputfiles"`
	Nsuccess    pgtype.Int4      `json:"nsuccess"`
	Nfailed     pgtype.Int4      `json:"nfailed"`
	Naborted    pgtype.Int4      `json:"naborted"`
}

type UpdateBatchSummaryOnAbortParams

type UpdateBatchSummaryOnAbortParams struct {
	ID       uuid.UUID        `json:"id"`
	Status   StatusEnum       `json:"status"`
	Doneat   pgtype.Timestamp `json:"doneat"`
	Naborted pgtype.Int4      `json:"naborted"`
}

type UpdateBatchSummaryParams

type UpdateBatchSummaryParams struct {
	ID          uuid.UUID        `json:"id"`
	Status      StatusEnum       `json:"status"`
	Doneat      pgtype.Timestamp `json:"doneat"`
	Outputfiles []byte           `json:"outputfiles"`
	Nsuccess    pgtype.Int4      `json:"nsuccess"`
	Nfailed     pgtype.Int4      `json:"nfailed"`
	Naborted    pgtype.Int4      `json:"naborted"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL