dumper

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DumpAllTablesData

func DumpAllTablesData(db *sql.DB, writer *bufio.Writer, schemaMetadata map[string]schemareader.Table,
	startingTables []schemareader.Table, whereFilterClause func(table schemareader.Table) string, onlyIfParentExistsTables []string)

func GetRowsFromKeys

func GetRowsFromKeys(db *sql.DB, table schemareader.Table, keys []TableKey) [][]sqlUtil.RowDataStructure

GetRowsFromKeys check if we should move this to a method in the type tableData

func PrintTableDataOrdered

func PrintTableDataOrdered(db *sql.DB, writer *bufio.Writer, schemaMetadata map[string]schemareader.Table,
	startingTable schemareader.Table, data DataDumper, options PrintSqlOptions)

func SubstituteForeignKey added in v0.1.0

func SubstituteForeignKey(db *sql.DB, table schemareader.Table, tables map[string]schemareader.Table, row []sqlUtil.RowDataStructure) []sqlUtil.RowDataStructure

Types

type Callback added in v0.1.0

type Callback func(db *sql.DB, writer *bufio.Writer, schemaMetadata map[string]schemareader.Table, table schemareader.Table, data DataDumper)

type DataDumper

type DataDumper struct {
	TableData map[string]TableDump
	Paths     map[string]bool
}

func DataCrawler

func DataCrawler(db *sql.DB, schemaMetadata map[string]schemareader.Table, startTable schemareader.Table, startQueryFilter string, startingDate string) DataDumper

DataCrawler will go through all the elements in the initialDataSet an extract related data for all tables presented in the schemaMetadata by following foreign keys and references to the table row The result will be a structure containing ID of each row which should be exported per table

type PrintSqlOptions

type PrintSqlOptions struct {
	TablesToClean            []string
	CleanWhereClause         string
	OnlyIfParentExistsTables []string
	PostOrderCallback        Callback
}

type TableDump

type TableDump struct {
	TableName string
	KeyMap    map[string]bool
	Keys      []TableKey
}

type TableKey

type TableKey struct {
	Key map[string]string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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