Documentation
¶
Index ¶
- Constants
- Variables
- func AlterPublicationAddTable(ctx context.Context, db DBQuerier, publicationName, tableName string) error
- func AlterPublicationDropTable(ctx context.Context, db DBQuerier, publicationName, tableName string) error
- func BlockHashSQL(schema, table string, primaryKeyCols []string, mode string, ...) (string, error)
- func BuildParentNodes(ctx context.Context, db DBQuerier, mtreeTable string, nodeLevel int) (int, error)
- func CheckRepSetExists(ctx context.Context, db DBQuerier, repSet string) (bool, error)
- func CheckSchemaExists(ctx context.Context, db DBQuerier, schema string) (bool, error)
- func CheckUserPrivileges(ctx context.Context, db DBQuerier, username, schema, table string) (*types.UserPrivileges, error)
- func ClearDirtyFlags(ctx context.Context, db DBQuerier, mtreeTable string, nodePositions []int64) error
- func CommitTimestampFilter(t *time.Time) string
- func ComputeLeafHashes(ctx context.Context, db DBQuerier, schema, table string, _ bool, key []string, ...) ([]byte, error)
- func CreateCDCMetadataTable(ctx context.Context, db DBQuerier) error
- func CreateCompositeMtreeTable(ctx context.Context, db DBQuerier, mtreeTable, compositeTypeName string) error
- func CreateCompositeType(ctx context.Context, db DBQuerier, compositeTypeName, keyTypeColumns string) error
- func CreateMetadataTable(ctx context.Context, db DBQuerier) error
- func CreatePublication(ctx context.Context, db DBQuerier, publicationName string) error
- func CreateReplicationOrigin(ctx context.Context, db DBQuerier, originName string) (uint32, error)
- func CreateReplicationSlot(ctx context.Context, db DBQuerier, slotName string) error
- func CreateSchema(ctx context.Context, db DBQuerier, schemaName string) error
- func CreateSimpleMtreeTable(ctx context.Context, db DBQuerier, mtreeTable, pkeyType string) error
- func CreateXORFunction(ctx context.Context, db DBQuerier) error
- func DeleteBlock(ctx context.Context, db DBQuerier, mtreeTable string, position int64) error
- func DeleteMetadata(ctx context.Context, db DBQuerier, schema, table string) error
- func DeleteParentNodes(ctx context.Context, db DBQuerier, mtreeTable string) error
- func DropCDCMetadataTable(ctx context.Context, db DBQuerier) error
- func DropCompositeType(ctx context.Context, db DBQuerier, compositeTypeName string) error
- func DropMetadataTable(ctx context.Context, db DBQuerier) error
- func DropMtreeTable(ctx context.Context, db DBQuerier, mtreeTable string) error
- func DropPublication(ctx context.Context, db DBQuerier, publicationName string) error
- func DropReplicationSlot(ctx context.Context, db DBQuerier, slotName string) error
- func DropXORFunction(ctx context.Context, db DBQuerier) error
- func EnsureHashVersionColumn(ctx context.Context, db DBQuerier) error
- func EnsurePgcrypto(ctx context.Context, db DBQuerier) error
- func FindBlocksToMerge(ctx context.Context, db DBQuerier, mtreeTableName string, ...) ([]types.BlockRange, error)
- func FindBlocksToMergeComposite(ctx context.Context, db DBQuerier, mtreeTable, schema, table string, ...) ([]types.BlockRange, error)
- func FindBlocksToMergeSimple(ctx context.Context, db DBQuerier, mtreeTable, schema, table, key string, ...) ([]types.BlockRange, error)
- func FindBlocksToSplit(ctx context.Context, db DBQuerier, mtreeTable string, insertsSinceUpdate int, ...) ([]types.BlockRange, error)
- func GeneratePkeyOffsetsQuery(schema, table string, keyColumns []string, tableSampleMethod string, ...) (string, error)
- func GetBlockCountComposite(ctx context.Context, db DBQuerier, mtreeTable, schema, table, pkeyCols string, ...) (*types.BlockCountComposite, error)
- func GetBlockCountSimple(ctx context.Context, db DBQuerier, mtreeTable, schema, table, key string, ...) (*types.BlockCountSimple, error)
- func GetBlockRowCount(ctx context.Context, db DBQuerier, schema string, table string, ...) (int64, error)
- func GetBlockSizeFromMetadata(ctx context.Context, db DBQuerier, schema, table string) (int, error)
- func GetBlockWithCount(ctx context.Context, db DBQuerier, mtreeTable, schema, table string, ...) (*types.BlockRangeWithCount, error)
- func GetBulkSplitPoints(ctx context.Context, db DBQuerier, schema, table string, key []string, ...) ([][]any, error)
- func GetCDCMetadata(ctx context.Context, db DBQuerier, publicationName string) (string, string, []string, error)
- func GetColumnTypes(ctx context.Context, db DBQuerier, schema, table string) (map[string]string, error)
- func GetColumns(ctx context.Context, db DBQuerier, schema, table string) ([]string, error)
- func GetCountComposite(ctx context.Context, db DBQuerier, schema, table, whereClause string) (int64, error)
- func GetCountSimple(ctx context.Context, db DBQuerier, schema, table, key, pkeyType string, ...) (int64, error)
- func GetDirtyAndNewBlocks(ctx context.Context, db DBQuerier, mtreeTable string, simplePrimaryKey bool, ...) ([]types.BlockRange, error)
- func GetFunctionsInSchema(ctx context.Context, db DBQuerier, schema string) ([]string, error)
- func GetHashVersion(ctx context.Context, db DBQuerier, schema, table string) (int, error)
- func GetIndicesInSchema(ctx context.Context, db DBQuerier, schema string) ([]string, error)
- func GetLeafRanges(ctx context.Context, db DBQuerier, mtreeTable string, nodePositions []int64, ...) ([]types.LeafRange, error)
- func GetMaxNodeLevel(ctx context.Context, db DBQuerier, mtreeTable string) (int, error)
- func GetMaxNodePosition(ctx context.Context, db DBQuerier, mtreeTable string) (int64, error)
- func GetMaxValComposite(ctx context.Context, db DBQuerier, schema, table string, pkeyCols []string, ...) ([]interface{}, error)
- func GetMaxValSimple(ctx context.Context, db DBQuerier, schema, table, key string, ...) (interface{}, error)
- func GetMinValComposite(ctx context.Context, db DBQuerier, schema, table string, pkeyCols []string) ([]interface{}, error)
- func GetMinValSimple(ctx context.Context, db DBQuerier, schema, table, key string) (interface{}, error)
- func GetNodeChildren(ctx context.Context, db DBQuerier, mtreeTable string, ...) ([]types.NodeChild, error)
- func GetPkeyColumnTypes(ctx context.Context, db DBQuerier, schema, table string, pkeys []string) (map[string]string, error)
- func GetPkeyOffsets(ctx context.Context, db DBQuerier, schema, table string, keyColumns []string, ...) ([]types.PkeyOffset, error)
- func GetPkeyType(ctx context.Context, db DBQuerier, schema, table, pkey string) (string, error)
- func GetPrimaryKey(ctx context.Context, db DBQuerier, schema, table string) ([]string, error)
- func GetReplicationOriginByName(ctx context.Context, db DBQuerier, originName string) (*uint32, error)
- func GetRootNode(ctx context.Context, db DBQuerier, mtreeTable string) (*types.RootNode, error)
- func GetRowCountEstimate(ctx context.Context, db DBQuerier, schema, table string) (int64, error)
- func GetRowCountEstimateFromMetadata(ctx context.Context, db DBQuerier, schema, table string) (int64, error)
- func GetSimplePrimaryKey(ctx context.Context, db DBQuerier, schema, table string) (bool, error)
- func GetSpockNodeAndSubInfo(ctx context.Context, db DBQuerier) ([]types.SpockNodeAndSubInfo, error)
- func GetSpockNodeNames(ctx context.Context, db DBQuerier) (map[string]string, error)
- func GetSpockOriginLSNForNode(ctx context.Context, db DBQuerier, originNodeName string) (*string, error)
- func GetSpockRepSetInfo(ctx context.Context, db DBQuerier) ([]types.SpockRepSetInfo, error)
- func GetSpockSlotLSNForNode(ctx context.Context, db DBQuerier, failedNode string) (*string, error)
- func GetTablesInRepSet(ctx context.Context, db DBQuerier, repSet string) ([]string, error)
- func GetTablesInSchema(ctx context.Context, db DBQuerier, schema string) ([]string, error)
- func GetViewsInSchema(ctx context.Context, db DBQuerier, schema string) ([]string, error)
- func InsertBlockRanges(ctx context.Context, db DBQuerier, mtreeTable string, nodePosition int64, ...) error
- func InsertBlockRangesBatchComposite(ctx context.Context, db DBQuerier, mtreeTable string, ...) error
- func InsertBlockRangesBatchSimple(ctx context.Context, db DBQuerier, mtreeTable string, ...) error
- func InsertCompositeBlockRanges(ctx context.Context, db DBQuerier, mtreeTable string, nodePosition int64, ...) error
- func MarkAllLeavesDirty(ctx context.Context, db DBQuerier, mtreeTable string) (int64, error)
- func MarkBlockDirty(ctx context.Context, db DBQuerier, mtreeTable, pkeyValue string) error
- func MaxColumnSize(ctx context.Context, db DBQuerier, schema, table, column string) (int64, error)
- func RemoveTableFromCDCMetadata(ctx context.Context, db DBQuerier, tableName, publicationName string) error
- func RenderSQL(t *template.Template, data any) (string, error)
- func ResetPositionsByStart(ctx context.Context, db DBQuerier, mtreeTable string, key []string, ...) error
- func ResetPositionsByStartFromTemp(ctx context.Context, db DBQuerier, mtreeTable string, offset int64) error
- func ResetReplicationOriginSession(ctx context.Context, db DBQuerier) error
- func ResetReplicationOriginXact(ctx context.Context, db DBQuerier) error
- func SanitiseIdentifier(ident string) error
- func SetupReplicationOriginSession(ctx context.Context, db DBQuerier, originName string) error
- func SetupReplicationOriginXact(ctx context.Context, db DBQuerier, originLSN string, ...) error
- func UpdateAllLeafNodePositionsToTemp(ctx context.Context, db DBQuerier, mtreeTable string, offset int64) error
- func UpdateBlockRangeEnd(ctx context.Context, db DBQuerier, mtreeTable string, rangeEnd any, ...) error
- func UpdateBlockRangeEndComposite(ctx context.Context, db DBQuerier, mtreeTable string, compositeTypeName string, ...) error
- func UpdateBlockRangeStart(ctx context.Context, db DBQuerier, mtreeTable string, rangeStart any, ...) error
- func UpdateBlockRangeStartComposite(ctx context.Context, db DBQuerier, mtreeTable string, compositeTypeName string, ...) error
- func UpdateCDCMetadata(ctx context.Context, db DBQuerier, publicationName, slotName, startLSN string, ...) error
- func UpdateHashVersion(ctx context.Context, db DBQuerier, schema, table string, version int) error
- func UpdateLeafHashes(ctx context.Context, db DBQuerier, mtreeTable string, leafHash []byte, ...) (int64, error)
- func UpdateLeafHashesBatch(ctx context.Context, db DBQuerier, mtreeTable string, ...) error
- func UpdateMaxVal(ctx context.Context, db DBQuerier, mtreeTable string, rangeEnd interface{}, ...) error
- func UpdateMetadata(ctx context.Context, db DBQuerier, schema, table string, totalRows int64, ...) error
- func UpdateMtreeCounters(ctx context.Context, db DBQuerier, mtreeTable string, isComposite bool, ...) error
- func UpdateNodePosition(ctx context.Context, db DBQuerier, mtreeTable string, ...) error
- func UpdateNodePositionsSequential(ctx context.Context, db DBQuerier, mtreeTable string, startPosition int64) error
- type DBQuerier
- type Templates
Constants ¶
View Source
const CurrentHashVersion = 2
CurrentHashVersion is the version of the hash algorithm used by this build. Increment when the SQL hash computation changes (e.g., switching from whole-row ::text to per-column concat_ws with trim_scale).
Variables ¶
View Source
var SQLTemplates = Templates{}/* 111 elements not displayed */
Functions ¶
func BlockHashSQL ¶
func BuildParentNodes ¶
func CheckRepSetExists ¶
func CheckSchemaExists ¶
func CheckUserPrivileges ¶
func CheckUserPrivileges(ctx context.Context, db DBQuerier, username, schema, table string) (*types.UserPrivileges, error)
TODO: Need to add Spock privilege checks!!
func ClearDirtyFlags ¶
func CommitTimestampFilter ¶ added in v1.9.0
CommitTimestampFilter returns a SQL predicate that restricts rows to those committed at or before the given timestamp. Frozen rows (where pg_xact_commit_timestamp returns NULL after VACUUM FREEZE) are always included. Returns an empty string when t is nil.
func ComputeLeafHashes ¶
func CreateCompositeType ¶
func CreatePublication ¶
func CreateReplicationOrigin ¶ added in v1.7.0
func CreateReplicationSlot ¶
func CreateSimpleMtreeTable ¶
func DeleteBlock ¶
func DeleteMetadata ¶
func DeleteParentNodes ¶
func DropCompositeType ¶
func DropMtreeTable ¶
func DropPublication ¶
func DropReplicationSlot ¶
func EnsureHashVersionColumn ¶ added in v1.6.0
func FindBlocksToMerge ¶
func FindBlocksToMergeSimple ¶
func FindBlocksToSplit ¶
func GetBlockCountComposite ¶
func GetBlockCountSimple ¶
func GetBlockRowCount ¶
func GetBlockWithCount ¶
func GetBulkSplitPoints ¶
func GetCDCMetadata ¶
func GetColumnTypes ¶
func GetColumns ¶
GetColumns retrieves the column names for a given table.
func GetCountComposite ¶
func GetCountSimple ¶
func GetDirtyAndNewBlocks ¶
func GetFunctionsInSchema ¶
func GetHashVersion ¶ added in v1.6.0
func GetIndicesInSchema ¶
func GetLeafRanges ¶
func GetMaxNodeLevel ¶
func GetMaxNodePosition ¶
func GetMaxValComposite ¶
func GetMaxValSimple ¶
func GetMinValComposite ¶
func GetMinValSimple ¶
func GetNodeChildren ¶
func GetPkeyColumnTypes ¶
func GetPkeyOffsets ¶
func GetPkeyType ¶
func GetPrimaryKey ¶
func GetReplicationOriginByName ¶ added in v1.7.0
func GetRootNode ¶
func GetRowCountEstimate ¶
func GetSimplePrimaryKey ¶
func GetSpockNodeAndSubInfo ¶
func GetSpockNodeNames ¶ added in v1.5.0
func GetSpockOriginLSNForNode ¶ added in v1.5.0
func GetSpockRepSetInfo ¶
func GetSpockSlotLSNForNode ¶ added in v1.5.0
func GetTablesInRepSet ¶
func GetTablesInSchema ¶
func GetViewsInSchema ¶
func InsertBlockRanges ¶
func MarkAllLeavesDirty ¶ added in v1.6.0
func MarkBlockDirty ¶
func MaxColumnSize ¶
func ResetPositionsByStart ¶
func ResetReplicationOriginSession ¶ added in v1.7.0
func ResetReplicationOriginXact ¶ added in v1.7.0
func SanitiseIdentifier ¶
func SetupReplicationOriginSession ¶ added in v1.7.0
func SetupReplicationOriginXact ¶ added in v1.7.0
func UpdateBlockRangeEnd ¶
func UpdateBlockRangeStart ¶
func UpdateCDCMetadata ¶
func UpdateHashVersion ¶ added in v1.6.0
func UpdateLeafHashes ¶
func UpdateLeafHashesBatch ¶ added in v1.3.1
func UpdateMaxVal ¶
func UpdateMetadata ¶
func UpdateMtreeCounters ¶
func UpdateNodePosition ¶
Types ¶
type Templates ¶
type Templates struct {
EstimateRowCount *template.Template
GetPrimaryKey *template.Template
GetColumnTypes *template.Template
GetColumns *template.Template
CheckUserPrivileges *template.Template
SpockNodeAndSubInfo *template.Template
SpockRepSetInfo *template.Template
EnsurePgcrypto *template.Template
GetSpockNodeNames *template.Template
CheckSchemaExists *template.Template
GetTablesInSchema *template.Template
GetViewsInSchema *template.Template
GetFunctionsInSchema *template.Template
GetIndicesInSchema *template.Template
CheckRepSetExists *template.Template
GetTablesInRepSet *template.Template
GetPkeyColumnTypes *template.Template
CreateMetadataTable *template.Template
GetPkeyOffsets *template.Template
CreateSimpleMtreeTable *template.Template
CreateIndex *template.Template
CreateCompositeType *template.Template
DropCompositeType *template.Template
CreateCompositeMtreeTable *template.Template
InsertCompositeBlockRanges *template.Template
CreateXORFunction *template.Template
GetPkeyType *template.Template
UpdateMetadata *template.Template
InsertBlockRanges *template.Template
InsertBlockRangesBatchSimple *template.Template
InsertBlockRangesBatchComposite *template.Template
TDBlockHashSQL *template.Template
MtreeLeafHashSQL *template.Template
UpdateLeafHashes *template.Template
UpdateLeafHashesBatch *template.Template
GetDirtyAndNewBlocks *template.Template
ClearDirtyFlags *template.Template
BuildParentNodes *template.Template
GetRootNode *template.Template
GetNodeChildren *template.Template
GetLeafRanges *template.Template
GetLeafRangesExpanded *template.Template
GetRowCountEstimate *template.Template
GetMaxValComposite *template.Template
UpdateMaxVal *template.Template
GetMaxValSimple *template.Template
GetCountComposite *template.Template
GetCountSimple *template.Template
DeleteParentNodes *template.Template
GetMaxNodePosition *template.Template
UpdateBlockRangeEnd *template.Template
UpdateNodePositionsTemp *template.Template
DeleteBlock *template.Template
UpdateNodePositionsSequential *template.Template
FindBlocksToSplit *template.Template
FindBlocksToMerge *template.Template
FindBlocksToMergeExpanded *template.Template
GetBlockCountComposite *template.Template
GetBlockCountSimple *template.Template
GetBlockSizeFromMetadata *template.Template
GetMaxNodeLevel *template.Template
DropXORFunction *template.Template
DropMetadataTable *template.Template
DropMtreeTable *template.Template
GetBlockRowCount *template.Template
GetBlockWithCount *template.Template
GetBlockWithCountExpanded *template.Template
UpdateNodePosition *template.Template
GetMaxColumnSize *template.Template
UpdateBlockRangeStart *template.Template
GetMinValComposite *template.Template
GetMinValSimple *template.Template
GetDirtyAndNewBlocksExpanded *template.Template
FindBlocksToSplitExpanded *template.Template
ResetPositionsByStart *template.Template
ResetPositionsByStartFromTemp *template.Template
ResetPositionsByStartExpanded *template.Template
GetBulkSplitPoints *template.Template
UpdateBlockRangeStartComposite *template.Template
UpdateBlockRangeEndComposite *template.Template
UpdateAllLeafNodePositionsToTemp *template.Template
MarkBlockDirty *template.Template
CreateCDCMetadataTable *template.Template
UpdateCDCMetadata *template.Template
AlterPublicationAddTable *template.Template
CreatePublication *template.Template
CreateReplicationSlot *template.Template
DropPublication *template.Template
DropReplicationSlot *template.Template
DropCDCMetadataTable *template.Template
GetCDCMetadata *template.Template
UpdateMtreeCounters *template.Template
GetReplicationSlotPID *template.Template
TerminateBackend *template.Template
CheckPIDExists *template.Template
CreateSchema *template.Template
AlterPublicationDropTable *template.Template
DeleteMetadata *template.Template
RemoveTableFromCDCMetadata *template.Template
GetSpockOriginLSNForNode *template.Template
GetSpockSlotLSNForNode *template.Template
EnsureHashVersionColumn *template.Template
GetHashVersion *template.Template
MarkAllLeavesDirty *template.Template
UpdateHashVersion *template.Template
GetReplicationOriginByName *template.Template
CreateReplicationOrigin *template.Template
SetupReplicationOriginSession *template.Template
ResetReplicationOriginSession *template.Template
SetupReplicationOriginXact *template.Template
ResetReplicationOriginXact *template.Template
}
Click to show internal directories.
Click to hide internal directories.