Documentation
¶
Overview ¶
Package fetch queries source database for objects and data
Index ¶
- Constants
- Variables
- func AlterTableChecks(p dispatch.TaskAdder, ctg catalog.Catalog)
- func AlterTablesDefaults(p dispatch.TaskAdder, ctg catalog.Catalog)
- func AlterTablesForeignKeys(p dispatch.TaskAdder, ctg catalog.Catalog)
- func AlterTablesKeys(p dispatch.TaskAdder, ctg catalog.Catalog)
- func CopyTables(p *dispatch.Plan, tables []catalog.Table, srcctg any)
- func CopyTask(source any, target catalog.Table, reqs []string) dispatch.Task
- func CreateIndexes(p dispatch.TaskAdder, ctg catalog.Catalog)
- func CreateRoles(p dispatch.TaskAdder, ctg catalog.Catalog)
- func CreateSchemas(p dispatch.TaskAdder, ctg catalog.Catalog)
- func CreateSequences(p dispatch.TaskAdder, ctg catalog.Catalog)
- func CreateTables(p dispatch.TaskAdder, ctg catalog.Catalog)
- func DataPriority(p int) int
- func RestartIdentities(tables []catalog.Table, src any) dispatch.Task
- func RestartSequences(seqs []catalog.Sequence, src any) dispatch.Task
- func Value(path, from, to string, chunked bool) valueFactory
Constants ¶
const ( PreData = 0 // CREATE role, schemas, table. Data = 10000 // one COPY per table, restart for sequences and identity. PostData = 20000 // CREATE indexes, constraints, etc. )
Task number ranges for dump sections.
Allocate 10k numbers for each of dump sections. This allows to handle quite big schemas.
Variables ¶
var CopyRate = monitoring.NewRate(" rows")
var CopyThroughput = monitoring.NewIRate("B")
var Params struct { Force bool Owner bool Clean bool PreData bool Data bool PostData bool }
var TableCount int
Functions ¶
func AlterTablesForeignKeys ¶
func CopyTables ¶
CopyTables instanciates COPY operations for a list of tables
func CopyTask ¶
CopyTask instanciates a COPY operation for a table
Task weight is source table row count. Generates a COPY statement for each batch of rows. Use SetupExecute to configure query output.
func CreateRoles ¶
CreateRoles generates CREATE ROLE tasks
func CreateSchemas ¶
CreateSchemas generates CREATE SCHEMA tasks
func CreateSequences ¶
CreateSequences generates CREATE SEQUENCE tasks
func CreateTables ¶
CreateTables generates CREATE TABLE tasks
func DataPriority ¶
DataPriority priorize data over DDL
Prevent post-data to run before sequences or copy, in case there is no logical dependencies. This way, task of each plan section are more clustered.
func RestartIdentities ¶
RestartIdentities fetches identities start from source and generates ALTER COLUMN.
Returns nil if no tables have identity column.
Requires source connection in context from database.WithConnection.
func RestartSequences ¶
RestartSequences fetches sequences start from source and generates ALTER SEQUENCE.
Returns nil if no sequences are given. Group sequence restart by schema.
Requires catalog.FilterSchemas to be set with schemas containing sequences. Requires source connection in context from database.WithConnection.
Types ¶
This section is empty.