Documentation ¶
Overview ¶
Package psql implements an event sink backed by a PostgreSQL database.
Index ¶
- type EventSink
- func (es *EventSink) DB() *sql.DB
- func (es *EventSink) GetTxByHash(hash []byte) (*abci.TxResult, error)
- func (es *EventSink) HasBlock(h int64) (bool, error)
- func (es *EventSink) IndexBlockEvents(h types.EventDataNewBlockHeader) error
- func (es *EventSink) IndexTxEvents(txrs []*abci.TxResult) error
- func (es *EventSink) SearchBlockEvents(ctx context.Context, q *query.Query) ([]int64, error)
- func (es *EventSink) SearchTxEvents(ctx context.Context, q *query.Query) ([]*abci.TxResult, error)
- func (es *EventSink) Stop() error
- func (es *EventSink) Type() indexer.EventSinkType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventSink ¶
type EventSink struct {
// contains filtered or unexported fields
}
EventSink is an indexer backend providing the tx/block index services. This implementation stores records in a PostgreSQL database using the schema defined in state/indexer/sink/psql/schema.sql.
func NewEventSink ¶
NewEventSink constructs an event sink associated with the PostgreSQL database specified by connStr. Events written to the sink are attributed to the specified chainID.
func (*EventSink) DB ¶
DB returns the underlying Postgres connection used by the sink. This is exported to support testing.
func (*EventSink) GetTxByHash ¶
GetTxByHash is not implemented by this sink, and reports an error for all queries.
func (*EventSink) HasBlock ¶
HasBlock is not implemented by this sink, and reports an error for all queries.
func (*EventSink) IndexBlockEvents ¶
func (es *EventSink) IndexBlockEvents(h types.EventDataNewBlockHeader) error
IndexBlockEvents indexes the specified block header, part of the indexer.EventSink interface.
func (*EventSink) SearchBlockEvents ¶
SearchBlockEvents is not implemented by this sink, and reports an error for all queries.
func (*EventSink) SearchTxEvents ¶
SearchTxEvents is not implemented by this sink, and reports an error for all queries.
func (*EventSink) Type ¶
func (es *EventSink) Type() indexer.EventSinkType
Type returns the structure type for this sink, which is Postgres.