Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Data ¶
type Data struct {
Out io.Writer
Connection *sql.DB
WhereClauseForTables map[string]string
IgnoreTables []string
// contains filtered or unexported fields
}
Data configures and drives a Postgres dump, mirroring the shape of pkg/util/mysql/go_mysqldump.Data.
func (*Data) Dump ¶
Dump writes a complete, replayable SQL dump of the database to d.Out.
Phases, in order: (1) DROP + CREATE TABLE for every table (columns only - no constraints yet), (2) COPY data for every table, (3) PK, then UNIQUE constraints, then secondary indexes, then CHECK constraints, then FOREIGN KEY constraints last (deferred so referenced tables/rows already exist and no cross-table topological sort is needed), (4) sequence `setval` restoration. This mirrors real pg_dump's schema/data/post-data staging.
Click to show internal directories.
Click to hide internal directories.