Documentation ¶
Index ¶
- type StagingFiles
- func (repo *StagingFiles) GetAfterID(ctx context.Context, sourceID, destinationID string, startID int64) ([]model.StagingFile, error)
- func (repo *StagingFiles) GetByID(ctx context.Context, ID int64) (model.StagingFile, error)
- func (repo *StagingFiles) GetInRange(ctx context.Context, sourceID, destinationID string, startID, endID int64) ([]model.StagingFile, error)
- func (repo *StagingFiles) GetSchemaByID(ctx context.Context, ID int64) (json.RawMessage, error)
- func (repo *StagingFiles) Insert(ctx context.Context, stagingFile *model.StagingFileWithSchema) (int64, error)
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
Click to show internal directories.
Click to hide internal directories.