merge

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package merge provides utilities for merging database schemas. It allows combining schemas from multiple sources while avoiding duplicates, supporting only additive operations (no deletion or modification of existing items).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMergeSummary

func GetMergeSummary(result *MergeResult) string

GetMergeSummary returns a human-readable summary of the merge result

Types

type MergeOptions

type MergeOptions struct {
	SkipDomains    bool
	SkipRelations  bool
	SkipEnums      bool
	SkipViews      bool
	SkipSequences  bool
	SkipTableNames map[string]bool // Tables to skip during merge (keyed by table name)
}

MergeOptions contains options for merge operations

type MergeResult

type MergeResult struct {
	SchemasAdded   int
	TablesAdded    int
	ColumnsAdded   int
	RelationsAdded int
	DomainsAdded   int
	EnumsAdded     int
	ViewsAdded     int
	SequencesAdded int
}

MergeResult represents the result of a merge operation

func MergeDatabases

func MergeDatabases(target, source *models.Database, opts *MergeOptions) *MergeResult

MergeDatabases merges the source database into the target database. Only adds missing items; existing items are not modified.

Jump to

Keyboard shortcuts

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