writer

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const DataTypeBigDecimal = 4
View Source
const DataTypeBigInt = 2
View Source
const DataTypeDecimal = 3
View Source
const DataTypeInt = 1
View Source
const DataTypeTimestamp = 6
View Source
const DataTypeVarChar = 5
View Source
const TableOperationCreateIfNotExists = 1

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

type Column struct {
	Name      string
	DataType  int
	MaxLength int
	Nullable  bool
	Mode      int
	Field     reflect.StructField
}

type DbWriter

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

func CreateDbWriter

func CreateDbWriter(
	ctx context.Context,
	pluginConfig config.PluginConfig,
	connectionFactoryFn func() (*sql.DB, error),
	requestCh chan Request,
	statsTracker common.WriterStatsTracker) *DbWriter

func (*DbWriter) Init

func (w *DbWriter) Init() error

func (*DbWriter) Run

func (w *DbWriter) Run()

type InsertDataOperation

type InsertDataOperation struct {
	Context            *TableContext
	Data               any
	InsertArgFactoryFn tracking.InsertArgFactoryFunc
}

type Request

type Request struct {
	TableOperation
	InsertDataOperation
	ResponseCh chan Response
	// contains filtered or unexported fields
}

func (*Request) Describe

func (r *Request) Describe() string

type Response

type Response struct {
	Error          error
	Context        *TableContext
	QueuedForRetry bool
}

type RetryableError

type RetryableError struct {
	Message              string
	Err                  error
	CausedByMissingTable bool
}

func NewRetryableError

func NewRetryableError(message string, err error) *RetryableError

func (*RetryableError) Error

func (e *RetryableError) Error() string

func (*RetryableError) Unwrap

func (e *RetryableError) Unwrap() error

type TableContext

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

type TableOperation

type TableOperation struct {
	Operation int
	Name      string
	Columns   []Column
}

Jump to

Keyboard shortcuts

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