Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetApplicableMigrations ¶
func GetApplicableMigrations(migrations []orm.Migration, src orm.VersionNumber, dest orm.VersionNumber) (applicableMigrations []orm.Migration, err error)
GetApplicableMigrations Fetches applicable migrations based on src and destination version numbers
func GetDBCleanUpFunction ¶
GetDBCleanUpFunction Gives you a function that dictates the DB clean up transaction
Types ¶
type GoRoomSchemaMaster ¶
type GoRoomSchemaMaster struct { Version orm.VersionNumber `gorm:"primary_key"` IdentityHash string }
GoRoomSchemaMaster Tracks the schema of entities against current version of DB
type Initializer ¶
type Initializer interface { Init(currentIdentityHash string) (shouldRetryAfterDestruction bool, err error) CalculateIdentityHash() (string, error) PerformDBCleanUp() error }
Initializer Interface that exposes functions for initializing a Room managed DB
type Room ¶
type Room struct {
// contains filtered or unexported fields
}
Room Tracks the database objects, properties and configuration
func New ¶
func New(entities []interface{}, dba orm.ORM, version orm.VersionNumber, migrations []orm.Migration, identityCalculator orm.IdentityHashCalculator) (room *Room, errors []error)
New Returns a new room struct that can be used to initialize and get a DB managed by room
func (*Room) CalculateIdentityHash ¶
CalculateIdentityHash Calculate the identity hash for current Room instance
func (*Room) PerformDBCleanUp ¶
PerformDBCleanUp Cleans up existing DB removing Room metadata and all known entities