writer

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoPayload occurs when there's no payload to insert.
	ErrNoPayload = errors.New("no payload")
	// ErrNoKey occurs when there is no value for key.
	ErrNoKey = errors.New("no key")
)

Functions

This section is empty.

Types

type Params

type Params struct {
	DB    *sqlx.DB
	Table string
}

Params is an incoming params for the New function.

type Writer

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

Writer implements a writer logic for Sap hana destination.

func New

func New(ctx context.Context, params Params) (*Writer, error)

New creates new instance of the Writer.

func (*Writer) Close

func (w *Writer) Close(context.Context) error

Close closes the underlying db connection.

func (*Writer) Delete

func (w *Writer) Delete(ctx context.Context, record sdk.Record) error

Delete deletes records by a key.

func (*Writer) Insert

func (w *Writer) Insert(ctx context.Context, record sdk.Record) error

Insert row to sql server db.

func (*Writer) Update

func (w *Writer) Update(ctx context.Context, record sdk.Record) error

Update updates records by a key.

Jump to

Keyboard shortcuts

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