dbinfo

package
v0.0.0-...-19e4ed3 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatabaseInfo

type DatabaseInfo struct {
	Tables            map[string]*TableInfo
	ColumnToTable     map[string][]string
	RelationshipGraph graph.Graph[string, string]
}

func GetDatabaseInfoResult

func GetDatabaseInfoResult(ctx context.Context, conn Queryer) (DatabaseInfo, error)

Gathers information about every table's column and foreign key.

type ForeignKey

type ForeignKey struct {
	ToTable          string
	ColumnConditions [][2]string
}

type Queryer

type Queryer interface {
	Query(ctx context.Context, sql string, args ...any) (pgx.Rows, error)
}

type TableInfo

type TableInfo struct {
	Name    string
	Columns []string
	// Constraint -> Fkey
	ForeignKeys map[string]*ForeignKey
}

Jump to

Keyboard shortcuts

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