gorm

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Migrations = []*gormigrate.Migration{
	v202311021600,
}

Migrations is a collection of storage migration patterns

Functions

This section is empty.

Types

type DataSourceTypeName

type DataSourceTypeName string
const (
	Mysql      DataSourceTypeName = "mysql"
	Postgresql DataSourceTypeName = "postgres"
	Sqlite     DataSourceTypeName = "sqlite"
)

type Option

type Option interface {
	Apply(*gorm.DB) error
}

An Option configures a gorm.DB

func SetConnMaxIdleTime

func SetConnMaxIdleTime(maxIdleTime time.Duration) Option

func SetConnMaxLifetime

func SetConnMaxLifetime(maxlifetime time.Duration) Option

func SetLogLevel

func SetLogLevel(logLevel logger.LogLevel) Option

func SetLogger

func SetLogger(logger logger.Interface) Option

func SetMaxIdleConns

func SetMaxIdleConns(maxIdleConns int) Option

func SetMaxOpenConns

func SetMaxOpenConns(maxOpenConns int) Option

type OptionFunc

type OptionFunc func(*gorm.DB) error

OptionFunc is a function that configures a gorm.DB

func (OptionFunc) Apply

func (f OptionFunc) Apply(engine *gorm.DB) error

Apply is a function that set value to gorm.DB

type Proof

type Proof struct {
	gorm.Model
	Address string `json:"address" gorm:"index,type:varchar(42)"` // hex encoded
	Denom   string `json:"denom" gorm:"index"`
	Proof   string `json:"proof" gorm:"type:text"` // hex encoded
	Amount  int64  `json:"amount"`
}

type SQLStore

type SQLStore struct {
	// contains filtered or unexported fields
}

SQLStore implements store.Store.

func NewSQLStore

func NewSQLStore(config *config.Config, options ...Option) (*SQLStore, error)

func (*SQLStore) Close

func (s *SQLStore) Close() error

Close implements store.Store.

func (*SQLStore) CountAccountAssetProofs

func (s *SQLStore) CountAccountAssetProofs() (int64, error)

CountAccountAssetProofs implements store.Store.

func (*SQLStore) GetAccountAssetProof

func (s *SQLStore) GetAccountAssetProof(address types.AccAddress, symbol string) (*store.Proof, error)

GetAccountProof implements store.Store.

func (*SQLStore) InsertAccountAssetProof

func (s *SQLStore) InsertAccountAssetProof(proof *store.Proof) error

InsertAccountProof implements a function to insert account proof.

type Version

type Version struct {
	ID   int64
	Name string
}

Version is a migrate version of database

Jump to

Keyboard shortcuts

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