Documentation
¶
Index ¶
- func GormMigrateModelSchemaToDb(db *gorm.DB, models ...interface{}) (err error)
- func GormMigrateSchemaToDb(db *gorm.DB, schema *DbSchema) (err error)
- type DbSchema
- func GormGetSchemaFromDb(db *gorm.DB) (schema *DbSchema, err error)
- func NewDbSchema() *DbSchema
- func NewDbSchemaFrom(i interface{}) (schema *DbSchema, err error)
- func NewDbSchemaFromFile(filename string) (schema *DbSchema, err error)
- func NewDbSchemaFromJSON(json string) (schema *DbSchema, err error)
- func NewDbSchemaFromMap(m map[string]interface{}) (schema *DbSchema, err error)
- func (instance *DbSchema) Get(name string) *DbSchemaTable
- func (instance *DbSchema) Has(name string) bool
- func (instance *DbSchema) Map() map[string]interface{}
- func (instance *DbSchema) Parse(i interface{}) (err error)
- func (instance *DbSchema) Put(table *DbSchemaTable)
- func (instance *DbSchema) String() string
- type DbSchemaColumn
- type DbSchemaTable
- func (instance *DbSchemaTable) Get(name string) *DbSchemaColumn
- func (instance *DbSchemaTable) Has(name string) bool
- func (instance *DbSchemaTable) Map() map[string]interface{}
- func (instance *DbSchemaTable) Parse(i interface{}) (err error)
- func (instance *DbSchemaTable) Put(column *DbSchemaColumn)
- func (instance *DbSchemaTable) String() string
- func (instance *DbSchemaTable) Struct() interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DbSchema ¶
type DbSchema struct {
Tables []*DbSchemaTable `json:"tables"`
}
func NewDbSchema ¶
func NewDbSchema() *DbSchema
func NewDbSchemaFrom ¶
func NewDbSchemaFromFile ¶
func NewDbSchemaFromJSON ¶
func NewDbSchemaFromMap ¶
func (*DbSchema) Get ¶
func (instance *DbSchema) Get(name string) *DbSchemaTable
func (*DbSchema) Put ¶
func (instance *DbSchema) Put(table *DbSchemaTable)
Put add or replace a table
type DbSchemaColumn ¶
type DbSchemaColumn struct {
Name string `json:"name"`
Nullable bool `json:"nullable"`
Type string `json:"type"`
Tag string `json:"tag"`
}
func (*DbSchemaColumn) Map ¶
func (instance *DbSchemaColumn) Map() map[string]interface{}
func (*DbSchemaColumn) Parse ¶
func (instance *DbSchemaColumn) Parse(i interface{}) (err error)
func (*DbSchemaColumn) String ¶
func (instance *DbSchemaColumn) String() string
type DbSchemaTable ¶
type DbSchemaTable struct {
Name string `json:"name"`
Columns []*DbSchemaColumn `json:"columns"`
}
func NewDbSchemaTable ¶
func NewDbSchemaTable() *DbSchemaTable
func (*DbSchemaTable) Get ¶
func (instance *DbSchemaTable) Get(name string) *DbSchemaColumn
func (*DbSchemaTable) Has ¶
func (instance *DbSchemaTable) Has(name string) bool
func (*DbSchemaTable) Map ¶
func (instance *DbSchemaTable) Map() map[string]interface{}
func (*DbSchemaTable) Parse ¶
func (instance *DbSchemaTable) Parse(i interface{}) (err error)
func (*DbSchemaTable) Put ¶
func (instance *DbSchemaTable) Put(column *DbSchemaColumn)
func (*DbSchemaTable) String ¶
func (instance *DbSchemaTable) String() string
func (*DbSchemaTable) Struct ¶
func (instance *DbSchemaTable) Struct() interface{}
Click to show internal directories.
Click to hide internal directories.