Documentation
¶
Overview ¶
Package model contains structs to represent the information extracted from a database, like table names, view names, column names, etc.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Column ¶
type Column struct {
SchemaName string
EntityName string
Name string
DataType string
Comment string
IsPrimaryKey bool
IsForeignKey bool
}
A representation of a database column.
Column contains data that can be extracted from the database. Main data is the name, type and comment. The rest is to be able to identify the Entity it belongs to.
type DatabaseDescription ¶
type DatabaseDescription struct {
Schemas []Schema
}
A container for the different Schemas for which descriptions where extracted.
DatabaseDescription contains a slice of `Schema`.
func (DatabaseDescription) String ¶
func (d DatabaseDescription) String() string
Returns a string representation of the DatabaseDescription struct.
type Entity ¶
type Entity struct {
SchemaName string
Name string
EntityType string
Columns []Column
Relations []Relation
Comment string
}
A representation of a database entity (table, view, for example).
Entity struct contains data that can be extracted from the database, like the name and the comment. It also has a slice of Column.
type Relation ¶ added in v1.0.3
type Relation struct {
SchemaName string
EntityName string
RelationName string
ColumnName string
ForeignEntitySchema string
ForeignEntityName string
ForeignColumnName string
}
A representation of a relation between 2 entities.
The Relation struct represents data about a foreign key.
type Schema ¶
A container for entities descritpions in the database.
Schema struct contains the name of the schema (or namespace) and the slice of Entity that belong to it.
func (Schema) GetEntitiesByType ¶
Helper function to filter entities by type ("view", "table")