pgpartitioner

package module
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PartitionCleanup

func PartitionCleanup(tx *sql.Tx, options PgPartitionsDeleteOptions) (partitionTablesDeleted []string, err error)

func PartitionCreate

func PartitionCreate(tx *sql.Tx, options PgPartitionsCreateOptions) (partitionTablesAdded []string, err error)

Types

type DailyPartitionOptions

type DailyPartitionOptions struct {
	TableName    string
	DaysForward  int
	DaysBackward int
}

func (*DailyPartitionOptions) BoundarySqlText

func (dailyPartitionOptions *DailyPartitionOptions) BoundarySqlText(boundaryTime time.Time) (boundarySqlTxt string)

func (*DailyPartitionOptions) NextBoundary

func (dailyPartitionOptions *DailyPartitionOptions) NextBoundary(curTime time.Time) (boundaryTime time.Time)

func (*DailyPartitionOptions) NotAfterBoundary

func (dailyPartitionOptions *DailyPartitionOptions) NotAfterBoundary() (boundaryTime time.Time)

func (*DailyPartitionOptions) NotBeforeBoundary

func (dailyPartitionOptions *DailyPartitionOptions) NotBeforeBoundary() (boundaryTime time.Time)

func (*DailyPartitionOptions) PartitionTable

func (dailyPartitionOptions *DailyPartitionOptions) PartitionTable(curTime time.Time) (partitionTable string)

func (*DailyPartitionOptions) PrevBoundary

func (dailyPartitionOptions *DailyPartitionOptions) PrevBoundary(curTime time.Time) (boundaryTime time.Time)

func (*DailyPartitionOptions) Table

func (dailyPartitionOptions *DailyPartitionOptions) Table() (table string)

type HourlyPartitionOptions

type HourlyPartitionOptions struct {
	TableName     string
	HoursForward  int
	HoursBackward int
}

func (*HourlyPartitionOptions) BoundarySqlText

func (hourlyPartitionOptions *HourlyPartitionOptions) BoundarySqlText(boundaryTime time.Time) (boundarySqlTxt string)

func (*HourlyPartitionOptions) NextBoundary

func (hourlyPartitionOptions *HourlyPartitionOptions) NextBoundary(curTime time.Time) (boundaryTime time.Time)

func (*HourlyPartitionOptions) NotAfterBoundary

func (hourlyPartitionOptions *HourlyPartitionOptions) NotAfterBoundary() (boundaryTime time.Time)

func (*HourlyPartitionOptions) NotBeforeBoundary

func (hourlyPartitionOptions *HourlyPartitionOptions) NotBeforeBoundary() (boundaryTime time.Time)

func (*HourlyPartitionOptions) PartitionTable

func (hourlyPartitionOptions *HourlyPartitionOptions) PartitionTable(curTime time.Time) (partitionTable string)

func (*HourlyPartitionOptions) PrevBoundary

func (hourlyPartitionOptions *HourlyPartitionOptions) PrevBoundary(curTime time.Time) (boundaryTime time.Time)

func (*HourlyPartitionOptions) Table

func (hourlyPartitionOptions *HourlyPartitionOptions) Table() (table string)

type PgPartitionsCreateOptions

type PgPartitionsCreateOptions interface {
	Table() (table string)
	BoundarySqlText(boundaryTime time.Time) (boundarySqlTxt string)
	PartitionTable(curTime time.Time) (partitionName string)
	PrevBoundary(curTime time.Time) (boundaryTime time.Time)
	NextBoundary(curTime time.Time) (boundaryTime time.Time)
	NotBeforeBoundary() (boundaryTime time.Time)
	NotAfterBoundary() (boundaryTime time.Time)
}

type PgPartitionsDeleteOptions

type PgPartitionsDeleteOptions interface {
	PartitionTable(curTime time.Time) (partitionName string)
	PrevBoundary(curTime time.Time) (boundaryTime time.Time)
	NotBeforeBoundary() (boundaryTime time.Time)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL