orm

package
v0.0.0-...-40809a1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2020 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IdentityHashCalculator

type IdentityHashCalculator interface {
	ConstructHash(entityModel interface{}) (ans string, err error)
}

IdentityHashCalculator Calculates Identity based on the entity model definition returned by ORM

type Migration

type Migration interface {
	GetBaseVersion() VersionNumber
	GetTargetVersion() VersionNumber
	Apply(db interface{}) error
}

Migration Interface against users can define their migrations on the DB

type ModelDefinition

type ModelDefinition struct {
	TableName   string
	EntityModel interface{}
}

ModelDefinition Interface to access Definition of ORM Entity Model

type ORM

type ORM interface {
	HasTable(entity interface{}) bool
	CreateTable(models ...interface{}) Result
	TruncateTable(entity interface{}) Result
	Create(entity interface{}) Result
	DropTable(entities ...interface{}) Result
	GetModelDefinition(entity interface{}) ModelDefinition
	GetUnderlyingORM() interface{}
	GetLatestSchemaIdentityHashAndVersion() (identityHash string, version int, err error)
	DoInTransaction(fc func(tx ORM) error) (err error) //In the event of error returned by fc rollback should happen, nil return value should lead to commit
}

ORM The orm component used by Room

type Result

type Result struct {
	Error error
}

Result Result from DB operations

type VersionNumber

type VersionNumber uint

VersionNumber Type for specifying version number across Room

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL