Documentation
¶
Index ¶
- func AutoMigrate(index string, dst ...interface{}) error
- func ClearIndexCache()
- func Connect() (*gorm.DB, error)
- func DB() *gorm.DB
- func GetIndexHeight(name string) (uint64, error)
- func LoadDBFromEnv() (*gorm.DB, error)
- func SetDB(gormDB *gorm.DB)
- func UpdateIndexHeight(name string, height uint64) error
- func UpdateIndexHeightByTx(tx *gorm.DB, name string, height uint64) error
- type BaseModel
- type IndexHeight
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AutoMigrate ¶ added in v1.4.0
AutoMigrate run auto migration for given models
func ClearIndexCache ¶ added in v1.18.0
func ClearIndexCache()
ClearIndexCache clears the in-memory index height cache, intended for testing only.
func GetIndexHeight ¶
func LoadDBFromEnv ¶ added in v1.4.0
func UpdateIndexHeight ¶
Types ¶
type IndexHeight ¶
type IndexHeight struct {
ID uint32 `gorm:"primary_key;auto_increment"`
Name string `gorm:"size:128;not null;unique"`
Height uint64 `sql:"type:bigint"`
}
func (*IndexHeight) ByName ¶
func (m *IndexHeight) ByName(name string) (*IndexHeight, error)
Click to show internal directories.
Click to hide internal directories.