writer

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type Params

type Params struct {
	DB                *sqlx.DB
	Table             string
	KeyColumns        []string
	SupportsMutations bool
}

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 ClickHouse destination.

func NewWriter

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

NewWriter creates new instance of the Writer.

func (*Writer) Delete

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

Delete deletes a record.

func (*Writer) Insert

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

Insert inserts a record.

func (*Writer) Update

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

Update updates a record.

Jump to

Keyboard shortcuts

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