Documentation
¶
Index ¶
- func SetupDatabaseSchema(ctx context.Context, dsnString string, schemaName string, ...) (protosql.Database, error)
- type Holder
- type Sinker
- func (s *Sinker) HandleBlockScopedData(ctx context.Context, data *pbsubstreamsrpc.BlockScopedData, isLive *bool, ...) (err error)
- func (s *Sinker) HandleBlockUndoSignal(ctx context.Context, undoSignal *pbsubstreamsrpc.BlockUndoSignal, ...) (err error)
- func (s *Sinker) LogStats()
- func (s *Sinker) Run(ctx context.Context) error
- type SinkerFactoryClickhouse
- type SinkerFactoryFunc
- type SinkerFactoryOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetupDatabaseSchema ¶
func SetupDatabaseSchema( ctx context.Context, dsnString string, schemaName string, outputModuleName string, rootMessageDescriptor protoreflect.MessageDescriptor, options SinkerFactoryOptions, logger *zap.Logger, tracer logging.Tracer, ) (protosql.Database, error)
SetupDatabaseSchema constructs the target Database for the given DSN and output message descriptor and ensures its schema exists: on a fresh database it creates the schema, tables and system tables and records the sink info hash; on an existing one it reconciles the sink info hash when a compatible migration is available. It returns the ready (but not opened) Database so callers can either start a sinker (run path) or stop right after schema setup (setup command). It is idempotent: on a database that is already set up with a matching hash, it performs no schema changes.
Types ¶
type Sinker ¶
func (*Sinker) HandleBlockScopedData ¶
func (s *Sinker) HandleBlockScopedData(ctx context.Context, data *pbsubstreamsrpc.BlockScopedData, isLive *bool, cursor *sink.Cursor) (err error)
func (*Sinker) HandleBlockUndoSignal ¶
func (s *Sinker) HandleBlockUndoSignal(ctx context.Context, undoSignal *pbsubstreamsrpc.BlockUndoSignal, cursor *sink.Cursor) (err error)
type SinkerFactoryClickhouse ¶
type SinkerFactoryFunc ¶
type SinkerFactoryFunc func(ctx context.Context, dsnString, schemaName string, logger *zap.Logger, tracer logging.Tracer) (*Sinker, error)
func SinkerFactory ¶
func SinkerFactory( baseSink *sink.Sinker, outputModuleName string, rootMessageDescriptor protoreflect.MessageDescriptor, options SinkerFactoryOptions, ) SinkerFactoryFunc
type SinkerFactoryOptions ¶
type SinkerFactoryOptions struct {
UseProtoOption bool
UseConstraints bool
UseTransactions bool
BlockBatchSize int
Parallel bool
Encoding bytes.Encoding
Clickhouse SinkerFactoryClickhouse
}
func (SinkerFactoryOptions) Defaults ¶
func (o SinkerFactoryOptions) Defaults() SinkerFactoryOptions
Click to show internal directories.
Click to hide internal directories.