Documentation
¶
Index ¶
- Constants
- func DumpToGraphviz(tables map[string]Table)
- func GetConnectionString(configFilePath string) string
- func GetDBconnection(configFilePath string) *sql.DB
- func ReadAllTablesSchema(db *sql.DB) map[string]Table
- func ReadTablesSchema(db *sql.DB, tableNames []string) map[string]Table
- type Reference
- type Table
- type UniqueIndex
Constants ¶
View Source
const (
VirtualIndexName = "virtual_main_unique_index"
)
Variables ¶
This section is empty.
Functions ¶
func DumpToGraphviz ¶
DumpToGraphviz outputs a dot representation of a schema. Use: go run . | dot -Tx11
func GetConnectionString ¶
GetConnectionString return the connection string for the database after reading config file for
func GetDBconnection ¶
GetDBconnection return the database connection
func ReadAllTablesSchema ¶
ReadTablesSchema inspects the DB and returns a list of tables
Types ¶
type Table ¶
type Table struct {
Name string
Export bool
Columns []string
UnexportColumns map[string]bool
ColumnIndexes map[string]int
PKColumns map[string]bool
PKSequence string
UniqueIndexes map[string]UniqueIndex
// a unique index is main when it is the preferred "natural" key
MainUniqueIndexName string
References []Reference
ReferencedBy []Reference
}
Table represents a DB table to dump
func (*Table) GetFirstReferenceFromColumn ¶
we are returning just one reference, the first one which uses the column we want
type UniqueIndex ¶
UniqueIndex represents an index among columns of a Table
Click to show internal directories.
Click to hide internal directories.