database

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DbLoader

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

DbLoader specifc state for database Loader provider.

func NewLoader

func NewLoader(ctx context.Context, log *logrus.Entry, ds datasource.Datasourcer, table string, where string) (*DbLoader, error)

NewLoader open the database connection, make the data query and return a Loader compatible object.

func (*DbLoader) Close

func (dl *DbLoader) Close(log *logrus.Entry) error

Close closes the datasource.

func (*DbLoader) Load

func (dl *DbLoader) Load(log *logrus.Entry) (types.Record, error)

Load reads the next record and return it.

func (*DbLoader) Name

func (dl *DbLoader) Name() string

Name give the name of the destination.

func (*DbLoader) Next

func (dl *DbLoader) Next() bool

Next moves to next record and return false if there is no more records.

type DbSaver

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

DbSaver specifc state for database Saver provider.

func NewSaver

func NewSaver(ctx context.Context, log *logrus.Entry, ds datasource.Datasourcer, table string, key string, mode string) (*DbSaver, error)

NewSaver open the database connection, prepare the insert statement and return a Saver compatible object.

func (*DbSaver) Close

func (saver *DbSaver) Close(log *logrus.Entry) error

Close closes the destination.

func (*DbSaver) Name

func (saver *DbSaver) Name() string

Name give the name of the destination.

func (*DbSaver) Reset

func (saver *DbSaver) Reset(log *logrus.Entry) (err error)

Reset reinitialize the destination (if possible).

func (*DbSaver) Save

func (saver *DbSaver) Save(log *logrus.Entry, record types.Record) error

Save writes the record to the destination.

Jump to

Keyboard shortcuts

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