Documentation
¶
Index ¶
Constants ¶
const ( DefaultBatchSize int = 1000 DefaultDelay time.Duration = 0 )
const CNeedsBackfillColumn = "_pgroll_needs_backfill"
CNeedsBackfillColumn is the name of the internal column created by pgroll to mark rows that must be backfilled
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backfill ¶
type Backfill struct {
*Config
// contains filtered or unexported fields
}
func New ¶
New creates a new backfill operation with the given options. The backfill is not started until `Start` is invoked.
func (*Backfill) Start ¶
Start updates all rows in the given table, in batches, using the following algorithm: 1. Get the primary key column for the table. 2. Get the first batch of rows from the table, ordered by the primary key. 3. Update each row in the batch, setting the value of the primary key column to itself. 4. Repeat steps 2 and 3 until no more rows are returned.
type CallbackFn ¶
type Config ¶ added in v0.10.0
type Config struct {
// contains filtered or unexported fields
}
func (*Config) AddCallback ¶ added in v0.10.0
func (c *Config) AddCallback(fn CallbackFn)
AddCallback adds a callback to the backfill operation. Callbacks are invoked after each batch is processed.
type OptionFn ¶
type OptionFn func(*Config)
func WithBatchDelay ¶
WithBatchDelay sets the delay between batches for the backfill operation.
func WithBatchSize ¶
WithBatchSize sets the batch size for the backfill operation.