Documentation
¶
Index ¶
- func CurrentVersion(directory, environment, schema string) (int64, error)
- func MigrateUp(directory, environment, schema string) error
- type DatabaseContext
- func (context *DatabaseContext) CheckTable(entity interface{}) error
- func (context *DatabaseContext) Delete(query interface{}) error
- func (context *DatabaseContext) Find(query interface{}, callback func(query interface{}))
- func (context *DatabaseContext) Insert(query ...interface{}) error
- func (context *DatabaseContext) Raw(query interface{}, params ...interface{}) error
- func (context *DatabaseContext) Save(query ...interface{}) error
- func (context *DatabaseContext) Select(query interface{}) error
- func (context *DatabaseContext) Update(query interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CurrentVersion ¶
CurrentVersion gets the database current version according to the migration status
Types ¶
type DatabaseContext ¶
DatabaseContext to help abstract the technical implementation per driver used.
func (*DatabaseContext) CheckTable ¶
func (context *DatabaseContext) CheckTable(entity interface{}) error
CheckTable ensures a the table exists for the persistor.
func (*DatabaseContext) Delete ¶
func (context *DatabaseContext) Delete(query interface{}) error
Delete removes the model from the data store
func (*DatabaseContext) Find ¶
func (context *DatabaseContext) Find(query interface{}, callback func(query interface{}))
Find will check if the model exists and run the additional functionality.
func (*DatabaseContext) Insert ¶
func (context *DatabaseContext) Insert(query ...interface{}) error
Insert persists the new model in the data store
func (*DatabaseContext) Raw ¶
func (context *DatabaseContext) Raw(query interface{}, params ...interface{}) error
Raw executes a string of SQL.
func (*DatabaseContext) Save ¶
func (context *DatabaseContext) Save(query ...interface{}) error
Save persists the model in the data store
func (*DatabaseContext) Select ¶
func (context *DatabaseContext) Select(query interface{}) error
Select returns the model from the data store
func (*DatabaseContext) Update ¶
func (context *DatabaseContext) Update(query interface{}) error
Update persists the existing model in the data store
Click to show internal directories.
Click to hide internal directories.