Versions in this module Expand all Collapse all v1 v1.0.0 Jun 14, 2023 Changes in this version + var ErrCursorNotFound = errors.New("cursor not found") + var ErrInvalidOnModuleHashMismatch = fmt.Errorf("not a valid OnModuleHashMismatch, try [%s]", ...) + func OnModuleHashMismatchNames() []string + type ColumnInfo struct + func NewColumnInfo(name string, databaseTypeName string, scanType any) *ColumnInfo + type CursorError struct + type DSN struct + type Loader struct + func NewLoader(clickhouseDSN string, flushInterval time.Duration, ...) (*Loader, error) + func (l *Loader) Delete(tableName string, primaryKey string) error + func (l *Loader) DeleteAllCursors(ctx context.Context) (err error) + func (l *Loader) DeleteCursor(ctx context.Context, moduleHash string) error + func (l *Loader) EntriesCount() uint64 + func (l *Loader) Flush(ctx context.Context, outputModuleHash string, cursor *sink.Cursor) (err error) + func (l *Loader) FlushInterval() time.Duration + func (l *Loader) GetAllCursors(ctx context.Context) (out map[string]*sink.Cursor, err error) + func (l *Loader) GetAvailableTablesInSchema() string + func (l *Loader) GetCursor(ctx context.Context, outputModuleHash string) (cursor *sink.Cursor, mistmatchDetected bool, err error) + func (l *Loader) GetDatabase() string + func (l *Loader) GetIdentifier() string + func (l *Loader) HasTable(tableName string) bool + func (l *Loader) Insert(tableName string, primaryKey string, data map[string]string) error + func (l *Loader) InsertCursor(ctx context.Context, moduleHash string, c *sink.Cursor) error + func (l *Loader) LoadTables() error + func (l *Loader) MarshalLogObject(encoder zapcore.ObjectEncoder) error + func (l *Loader) Setup(ctx context.Context, schemaFile string) error + func (l *Loader) Update(tableName string, primaryKey string, data map[string]string) error + func (l *Loader) UpdateCursor(ctx context.Context, tx *sql.Tx, moduleHash string, c *sink.Cursor) error + type OnModuleHashMismatch uint + const OnModuleHashMismatchError + const OnModuleHashMismatchIgnore + const OnModuleHashMismatchWarn + func ParseOnModuleHashMismatch(name string) (OnModuleHashMismatch, error) + func (x *OnModuleHashMismatch) UnmarshalText(text []byte) error + func (x OnModuleHashMismatch) IsValid() bool + func (x OnModuleHashMismatch) MarshalText() ([]byte, error) + func (x OnModuleHashMismatch) String() string + type Operation struct + func (o *Operation) String() string + type OperationType string + const OperationTypeDelete + const OperationTypeInsert + const OperationTypeUpdate + type Queryable interface + type TableInfo struct + func NewTableInfo(name, primaryKeyColumnName string, columnsByName map[string]*ColumnInfo) (*TableInfo, error) + type TypeGetter func(tableName string, columnName string) (reflect.Type, error)