Documentation
¶
Index ¶
- func NewGORM(db *gorm.DB) orm.ORM
- type EntityHashConstructor
- type GORMAdapter
- func (adapter *GORMAdapter) Create(entity interface{}) orm.Result
- func (adapter *GORMAdapter) CreateTable(entities ...interface{}) orm.Result
- func (adapter *GORMAdapter) DoInTransaction(fc func(tx orm.ORM) error) (err error)
- func (adapter *GORMAdapter) DropTable(entities ...interface{}) orm.Result
- func (adapter *GORMAdapter) GetLatestSchemaIdentityHashAndVersion() (identityHash string, version int, err error)
- func (adapter *GORMAdapter) GetModelDefinition(entity interface{}) (modelDefinition orm.ModelDefinition)
- func (adapter *GORMAdapter) GetUnderlyingORM() interface{}
- func (adapter *GORMAdapter) HasTable(entity interface{}) bool
- func (adapter *GORMAdapter) TruncateTable(entity interface{}) orm.Result
- type GORMEntityModel
- type GORMField
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EntityHashConstructor ¶
type EntityHashConstructor struct{}
EntityHashConstructor Constructs entity Hash for a given ORM Model description
func (*EntityHashConstructor) ConstructHash ¶
func (c *EntityHashConstructor) ConstructHash(input interface{}) (ans string, err error)
ConstructHash Constructs Hash for given input
type GORMAdapter ¶
type GORMAdapter struct {
// contains filtered or unexported fields
}
GORMAdapter Adpater for GORM as used by Room
func (*GORMAdapter) Create ¶
func (adapter *GORMAdapter) Create(entity interface{}) orm.Result
Create Create a row
func (*GORMAdapter) CreateTable ¶
func (adapter *GORMAdapter) CreateTable(entities ...interface{}) orm.Result
CreateTable Create a Table
func (*GORMAdapter) DoInTransaction ¶
func (adapter *GORMAdapter) DoInTransaction(fc func(tx orm.ORM) error) (err error)
DoInTransaction Perform operations specified in the input function in a transaction
func (*GORMAdapter) DropTable ¶
func (adapter *GORMAdapter) DropTable(entities ...interface{}) orm.Result
DropTable Drop a table
func (*GORMAdapter) GetLatestSchemaIdentityHashAndVersion ¶
func (adapter *GORMAdapter) GetLatestSchemaIdentityHashAndVersion() (identityHash string, version int, err error)
GetLatestSchemaIdentityHashAndVersion Query the latest schema master entry
func (*GORMAdapter) GetModelDefinition ¶
func (adapter *GORMAdapter) GetModelDefinition(entity interface{}) (modelDefinition orm.ModelDefinition)
GetModelDefinition Get representation of a database table(entity) as done by ORM
func (*GORMAdapter) GetUnderlyingORM ¶
func (adapter *GORMAdapter) GetUnderlyingORM() interface{}
GetUnderlyingORM Get the underlying ORM for advanced usage
func (*GORMAdapter) HasTable ¶
func (adapter *GORMAdapter) HasTable(entity interface{}) bool
HasTable Check Table exists
func (*GORMAdapter) TruncateTable ¶
func (adapter *GORMAdapter) TruncateTable(entity interface{}) orm.Result
TruncateTable Delete All Values from table
type GORMEntityModel ¶
type GORMEntityModel struct {
Fields []*GORMField
}
GORMEntityModel Entity Model for GORM for Room