sql

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InsertFunc

type InsertFunc func(*sql.Tx, *streams.Message) error

type Sink

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

Sink represents a SQL sink processor.

func NewSink

func NewSink(db *sql.DB, fn InsertFunc, batch int, opts ...SinkFunc) *Sink

NewSink creates a new batch sql insert sink.

func (*Sink) Close

func (p *Sink) Close() error

Close closes the processor.

func (*Sink) Process

func (p *Sink) Process(msg *streams.Message) error

Process processes the stream record.

func (*Sink) WithPipe added in v0.3.0

func (p *Sink) WithPipe(pipe streams.Pipe)

WithPipe sets the pipe on the Processor.

type SinkFunc

type SinkFunc func(*Sink)

func WithBeginFn

func WithBeginFn(fn TxFunc) SinkFunc

func WithCommitFn

func WithCommitFn(fn TxFunc) SinkFunc

type TxFunc

type TxFunc func(*sql.Tx) error

TxFunc represents a function that receives a sql transaction.

Jump to

Keyboard shortcuts

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