Documentation
¶
Index ¶
- func CreateTables() (result bool, err error)
- func DeleteAllTableMetadata(name string) (err error)
- func DeleteAllTargetDBMetadata() (err error)
- func MarkNonExistAllTableMetadata(name string) (err error)
- func SetTableExists(name string) (err error)
- func Setup(db *gorp.DbMap, targetDatabaseID int)
- func TableRegistered(name string) (reg bool, err error)
- func UpdateCache() error
- func UseCache(state bool) (err error)
- type Metadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTables ¶
CreateTables Create the Metadata table
func DeleteAllTableMetadata ¶
DeleteAllTableMetadata Delete all of a Table's metadata.
func DeleteAllTargetDBMetadata ¶
func DeleteAllTargetDBMetadata() (err error)
DeleteAllTargetDBMetadata Delete all of a Table's metadata. Intended for sandbox use.
func MarkNonExistAllTableMetadata ¶
MarkNonExistAllTableMetadata Delete all of a Table's metadata.
func SetTableExists ¶
SetTableExists Set all fields on the table to exist
func TableRegistered ¶
TableRegistered Returns a boolean indicating that the Table named 'name' is registered in the Metadata table
func UpdateCache ¶
func UpdateCache() error
UpdateCache Build a localstore of the Metadata Management DB for the target DB
Types ¶
type Metadata ¶
type Metadata struct { MDID int64 `db:"mdid, autoincrement, primarykey" json:"mdid"` DB int `db:"db" json:"db"` PropertyID string `db:"property_id" json:"property_id"` ParentID string `db:"parent_id" json:"parent_id"` Type string `db:"type" json:"type"` Name string `db:"name" json:"name"` Exists bool `db:"exists" json:"exists"` }
Metadata This struct stores the identification information for each table and table field in the target database. This data is used to match the schema of the target database to the YAML schema
func GetTableByName ¶
GetTableByName Get a Table metadata object from the database by name
func LoadAllTableMetadata ¶
LoadAllTableMetadata Load all of the Metadata rows for a table with the matching Property and Database IDs
func (*Metadata) IsTable ¶
IsTable Returns if there is a value for ParentID. If empty the property is a table.
func (*Metadata) OnCreate ¶
OnCreate Check if the Metadata is known to the database yet. Depends on MDID being set != 0