Documentation ¶
Overview ¶
Package model contains the metadata structure used for generating data dictionaries along the the functions for initializing the metadata structure and loading (from go-db-mata), transforming, and retrieving that metadata
Index ¶
- type CheckConstraint
- type Column
- type Dependency
- type Domain
- type ForeignKey
- type Index
- type MetaData
- func (md *MetaData) FindCheckConstraints(schemaName string, tableName string) (d []CheckConstraint)
- func (md *MetaData) FindChildKeys(schemaName string, tableName string) (d []ForeignKey)
- func (md *MetaData) FindColumns(schemaName string, tableName string) (d []Column)
- func (md *MetaData) FindDependencies(schemaName string, objectName string) (d []Dependency)
- func (md *MetaData) FindDependents(schemaName string, objectName string) (d []Dependency)
- func (md *MetaData) FindDomains(schemaName string) (d []Domain)
- func (md *MetaData) FindIndexes(schemaName string, tableName string) (d []Index)
- func (md *MetaData) FindParentKeys(schemaName string, tableName string) (d []ForeignKey)
- func (md *MetaData) FindPrimaryKeys(schemaName string, tableName string) (d []PrimaryKey)
- func (md *MetaData) FindTables(schemaName string) (d []Table)
- func (md *MetaData) FindUniqueConstraints(schemaName string, tableName string) (d []UniqueConstraint)
- func (md *MetaData) FindUserTypes(schemaName string) (d []UserType)
- func (md *MetaData) LoadCatalog(x *m.Catalog)
- func (md *MetaData) LoadCheckConstraints(x *[]m.CheckConstraint)
- func (md *MetaData) LoadColumns(x *[]m.Column)
- func (md *MetaData) LoadDependencies(x *[]m.Dependency)
- func (md *MetaData) LoadDomains(x *[]m.Domain)
- func (md *MetaData) LoadForeignKeys(x *[]m.ReferentialConstraint)
- func (md *MetaData) LoadIndexes(x *[]m.Index)
- func (md *MetaData) LoadPrimaryKeys(x *[]m.PrimaryKey)
- func (md *MetaData) LoadSchemas(x *[]m.Schema)
- func (md *MetaData) LoadTables(x *[]m.Table)
- func (md *MetaData) LoadUniqueConstraints(x *[]m.UniqueConstraint)
- func (md *MetaData) LoadUserTypes(x *[]m.Type)
- func (md *MetaData) SortCheckConstraints(x []CheckConstraint)
- func (md *MetaData) SortColumns(x []Column)
- func (md *MetaData) SortDependencies(x []Dependency)
- func (md *MetaData) SortDomains(x []Domain)
- func (md *MetaData) SortForeignKeys(x []ForeignKey)
- func (md *MetaData) SortIndexes(x []Index)
- func (md *MetaData) SortSchemas(x []Schema)
- func (md *MetaData) SortTables(x []Table)
- func (md *MetaData) SortUniqueConstraints(x []UniqueConstraint)
- type PrimaryKey
- type Schema
- type Table
- type UniqueConstraint
- type UserType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CheckConstraint ¶
type CheckConstraint struct { DBName string SchemaName string TableName string Name string CheckClause string Status string Comment string }
CheckConstraint contains the metadata for a check constraint
type Column ¶
type Column struct { DBName string SchemaName string TableName string Name string OrdinalPosition int32 IsNullable string DataType string Default string DomainDBName string DomainSchema string DomainName string Comment string }
Column contains the metadata for a table/view column
type Dependency ¶
type Dependency struct { DBName string ObjectSchema string ObjectName string ObjectOwner string ObjectType string IsLinkable bool DepDBName string DepObjectSchema string DepObjectName string DepObjectOwner string DepObjectType string DepIsLinkable bool }
Dependency contains the metadata for a database object dependency
type Domain ¶
type Domain struct { DBName string SchemaName string Name string Owner string DataType string Default string Comment string }
Domain contains the metadata for a user defined domain
type ForeignKey ¶
type ForeignKey struct { DBName string SchemaName string TableName string TableColumns string Name string RefDBName string RefSchemaName string RefTableName string RefTableColumns string RefConstraintName string MatchOption string UpdateRule string DeleteRule string IsEnforced string IsIndexed string Comment string }
ForeignKey contains the metadata for a foreign key constraint
type Index ¶
type Index struct { DBName string SchemaName string Name string IndexType string IndexColumns string TableSchema string TableName string IsUnique string Comment string }
Index contains the metadata for an index
type MetaData ¶
type MetaData struct { TmspGenerated string DBEngine string CommentsFormat string OutputDir string File string Version string CharacterSet string Name string Alias string Owner string Comment string Cfg config.Config Schemas []Schema Tables []Table Columns []Column Domains []Domain Indexes []Index CheckConstraints []CheckConstraint UniqueConstraints []UniqueConstraint ForeignKeys []ForeignKey PrimaryKeys []PrimaryKey Dependencies []Dependency Dependents []Dependency UserTypes []UserType }
MetaData is the metadata structure used for generating a data dictionary
func (*MetaData) FindCheckConstraints ¶
func (md *MetaData) FindCheckConstraints(schemaName string, tableName string) (d []CheckConstraint)
FindCheckConstraints returns the check contraint metadata that matches the specified schema/table name. If no schema is specified then all check constraints are returned. If only the schema is specified then all check constraints for that schema are returned.
func (*MetaData) FindChildKeys ¶
func (md *MetaData) FindChildKeys(schemaName string, tableName string) (d []ForeignKey)
FindChildKeys returns the foreign key contraint metadata for all child tables of the specified schema/table name. If no schema is specified then all foreign key constraints are returned. If only the schema is specified then all foreign keys for the child tables for that schema are returned.
func (*MetaData) FindColumns ¶
FindColumns returns the column metadata that matches the specified schema/table name. If no schema is specified then all columns are returned. If only the schema is specified then all columns for that schema are returned.
func (*MetaData) FindDependencies ¶
func (md *MetaData) FindDependencies(schemaName string, objectName string) (d []Dependency)
FindDependencies returns the object metadata that the specified schema/object is dependent on. If no schema is specified then all dependencies are returned. If only the schema is specified then all dependencies for objects in that schema are returned.
func (*MetaData) FindDependents ¶
func (md *MetaData) FindDependents(schemaName string, objectName string) (d []Dependency)
FindDependents returns the object metadata for the database objects that depend on the specified schema/object. If no schema is specified then all dependencies are returned. If only the schema is specified then all objects that depend on objects in that schema are returned.
func (*MetaData) FindDomains ¶
FindDomains returns the user-defined domain metadata that matches the specified schema. If no schema is specified then all user-defined domains are returned.
func (*MetaData) FindIndexes ¶
FindIndexes returns the index metadata that matches the specified schema/table name. If no schema is specified then all indices are returned. If only the schema is specified then all indices for that schema are returned.
func (*MetaData) FindParentKeys ¶
func (md *MetaData) FindParentKeys(schemaName string, tableName string) (d []ForeignKey)
FindParentKeys returns the foreign key contraint metadata for all parent keys that match the specified schema/table name. If no schema is specified then all foreign key are returned. If only the schema is specified then all foreign key constraints for that parent tables for that schema are returned.
func (*MetaData) FindPrimaryKeys ¶
func (md *MetaData) FindPrimaryKeys(schemaName string, tableName string) (d []PrimaryKey)
FindPrimaryKeys returns the primary key contraint metadata that matches the specified schema/table name. If no schema is specified then all primary key constraints are returned. If only the schema is specified then all primary key constraints for that schema are returned.
func (*MetaData) FindTables ¶
FindTables returns the table metadata that matches the specified schema. If no schema is specified then all tables are returned.
func (*MetaData) FindUniqueConstraints ¶
func (md *MetaData) FindUniqueConstraints(schemaName string, tableName string) (d []UniqueConstraint)
FindUniqueConstraints returns the unique contraint metadata that matches the specified schema/table name. If no schema is specified then all unique constraints are returned. If only the schema is specified then all unique constraints for that schema are returned.
func (*MetaData) FindUserTypes ¶
FindUserTypes returns the user-defined datatype metadata that matches the specified schema. If no schema is specified then all user-defined datatypes are returned.
func (*MetaData) LoadCatalog ¶
LoadCatalog loads the catalog information from go-db-meta into the dictionary metadata structure
func (*MetaData) LoadCheckConstraints ¶
func (md *MetaData) LoadCheckConstraints(x *[]m.CheckConstraint)
LoadCheckConstraints loads the check constraint information from go-db-meta into the dictionary metadata structure
func (*MetaData) LoadColumns ¶
LoadColumns loads the column information from go-db-meta into the dictionary metadata structure
func (*MetaData) LoadDependencies ¶
func (md *MetaData) LoadDependencies(x *[]m.Dependency)
LoadDependencies loads the object dependency information from go-db-meta into the dictionary metadata structure
func (*MetaData) LoadDomains ¶
LoadDomains loads the user defined domain information from go-db-meta into the dictionary metadata structure
func (*MetaData) LoadForeignKeys ¶
func (md *MetaData) LoadForeignKeys(x *[]m.ReferentialConstraint)
LoadForeignKeys loads the foreign key relationship information from go-db-meta into the dictionary metadata structure
func (*MetaData) LoadIndexes ¶
LoadIndexes loads the index information from go-db-meta into the dictionary metadata structure
func (*MetaData) LoadPrimaryKeys ¶
func (md *MetaData) LoadPrimaryKeys(x *[]m.PrimaryKey)
LoadPrimaryKeys loads the primary key information from go-db-meta into the dictionary metadata structure
func (*MetaData) LoadSchemas ¶
LoadSchemas loads the schema information from go-db-meta into the dictionary metadata structure
func (*MetaData) LoadTables ¶
LoadTables loads the table information from go-db-meta into the dictionary metadata structure
func (*MetaData) LoadUniqueConstraints ¶
func (md *MetaData) LoadUniqueConstraints(x *[]m.UniqueConstraint)
LoadUniqueConstraints loads the unique constraint information from go-db-meta into the dictionary metadata structure
func (*MetaData) LoadUserTypes ¶
LoadUserTypes loads the user defined datatype information from go-db-meta into the dictionary metadata structure
func (*MetaData) SortCheckConstraints ¶
func (md *MetaData) SortCheckConstraints(x []CheckConstraint)
SortCheckConstraints sets the default sort order for a list of check constraints
func (*MetaData) SortColumns ¶
SortColumns sets the default sort order for a list of columns
func (*MetaData) SortDependencies ¶
func (md *MetaData) SortDependencies(x []Dependency)
SortDependencies sets the default sort order for a list of object dependencies
func (*MetaData) SortDomains ¶
SortDomains sets the default sort order for a list of domains
func (*MetaData) SortForeignKeys ¶
func (md *MetaData) SortForeignKeys(x []ForeignKey)
SortForeignKeys sets the default sort order for a list of foreign key constraints
func (*MetaData) SortIndexes ¶
SortIndexes sets the default sort order for a list of indices
func (*MetaData) SortSchemas ¶
SortSchemas sets the default sort order for a list of schemas
func (*MetaData) SortTables ¶
SortTables sets the default sort order for a list of tables
func (*MetaData) SortUniqueConstraints ¶
func (md *MetaData) SortUniqueConstraints(x []UniqueConstraint)
SortUniqueConstraints sets the default sort order for a list of unique constraints
type PrimaryKey ¶
type PrimaryKey struct { DBName string SchemaName string TableName string Name string Columns string Status string Comment string }
PrimaryKey contains the metadata for a primary key
type Table ¶
type Table struct { DBName string SchemaName string Name string Owner string TableType string RowCount int64 Comment string Query string }
Table contains the (hight level) metadata for a table/view/materialized view. Other attributes (i.e. columns, indices, etc.) will have their own metadata structures.