# Functions
Batch is an iterator for batches of records.
NewAdvisoryLock returns an advisoryLocker.
No description provided by the author
No description provided by the author
NewLeaseLock creates a "leaseLock" - an entity that tries to take an exclusive lease on the database.
NewLockedDB creates a new instance of LockedDB.
No description provided by the author
No description provided by the author
No description provided by the author
OpenUnlockedDB just opens DB connection, without any DB locks.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
WithLongQueryTimeout prevents the usage of the `DefaultQueryTimeout` duration and uses `OneMinuteQueryTimeout` instead Some queries need to take longer when operating over big chunks of data, like deleting jobs, but we need to keep some upper bound timeout.
WithParentCtx sets or overwrites the parent ctx.
If the parent has a timeout, just use that instead of DefaultTimeout.
WithQueryer sets the queryer.
No description provided by the author
# Constants
BatchSize is the default number of DB records to access in one batch.
Postgres channel to listen for new eth_txes.
NOTE: This is the default level in Postgres anyway, we just make it explicit here.
# Variables
DefaultIdleInTxSessionTimeout controls the max time we leave a transaction open and idle.
DefaultLockTimeout controls the max time we will wait for any kind of database lock.
DefaultQueryTimeout is a reasonable upper bound for how long a SQL query should take.
# Structs
No description provided by the author
NullEventBroadcaster implements null pattern for event broadcaster.
No description provided by the author
Q wraps an underlying queryer (either a *sqlx.DB or a *sqlx.Tx)
It is designed to make handling *sqlx.Tx or *sqlx.DB a little bit safer by preventing footguns such as having no deadline on contexts.
No description provided by the author
No description provided by the author
# Interfaces
AdvisoryLock is an interface for postgresql advisory locks.
No description provided by the author
No description provided by the author
EventBroadcaster opaquely manages a collection of Postgres event listeners and broadcasts events to subscribers (with an optional payload filter).
LeaseLock handles taking an exclusive lease on database access.
No description provided by the author
LockedDB bounds DB connection and DB locks.
No description provided by the author
No description provided by the author
go:generate mockery --quiet --name Queryer --output ./mocks/ --case=underscore.
Subscription represents a subscription to a Postgres event channel.
TxBeginner can be a db or a conn, anything that implements BeginTxx.
# Type aliases
BatchFunc is the function to execute on each batch of records, should return the count of records affected.
Limit is a helper driver.Valuer for LIMIT queries which uses nil/NULL for negative values.
QOpt pattern for ORM methods aims to clarify usage and remove some common footguns, notably:
1.
No description provided by the author
No description provided by the author
No description provided by the author