repo

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StagingFiles

type StagingFiles struct {
	DB  *sql.DB
	Now func() time.Time
	// contains filtered or unexported fields
}

StagingFiles is a repository for inserting and querying staging files.

func (*StagingFiles) GetAfterID

func (repo *StagingFiles) GetAfterID(ctx context.Context, sourceID, destinationID string, startID int64) ([]model.StagingFile, error)

GetAfterID returns staging files in (startID, +Inf) range.

func (*StagingFiles) GetByID

func (repo *StagingFiles) GetByID(ctx context.Context, ID int64) (model.StagingFile, error)

GetByID returns staging file with the given ID.

func (*StagingFiles) GetInRange

func (repo *StagingFiles) GetInRange(ctx context.Context, sourceID, destinationID string, startID, endID int64) ([]model.StagingFile, error)

GetInRange returns staging files in [startID, endID] range inclusive.

func (*StagingFiles) GetSchemaByID added in v1.4.3

func (repo *StagingFiles) GetSchemaByID(ctx context.Context, ID int64) (json.RawMessage, error)

GetSchemaByID returns staging file schema field the given ID.

func (*StagingFiles) Insert

func (repo *StagingFiles) Insert(ctx context.Context, stagingFile *model.StagingFileWithSchema) (int64, error)

Insert inserts a staging file into the staging files table. It returns the ID of the inserted staging file.

NOTE: The following fields are ignored and set by the database: - ID - Error - CreatedAt - UpdatedAt

Jump to

Keyboard shortcuts

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