Documentation ¶
Index ¶
- Variables
- func ApplyMigrations(db *sql.DB, assetNames []string, assetGetter func(name string) ([]byte, error)) error
- func Migrate(db *sql.DB) error
- func Open(path, key string, mc ...MigrationConfig) (*sql.DB, error)
- func OpenWithIter(path, key string, kdfIter int, mc ...MigrationConfig) (*sql.DB, error)
- type Migration
- type MigrationConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultMigrations = []Migration{ { Names: nodemigrations.AssetNames(), Getter: nodemigrations.Asset, }, { Names: peersmigrations.AssetNames(), Getter: peersmigrations.Asset, }, { Names: statemigrations.AssetNames(), Getter: statemigrations.Asset, }, { Names: storemigrations.AssetNames(), Getter: storemigrations.Asset, }, }
DefaultMigrations is a collection of all mvds components migrations.
Functions ¶
func ApplyMigrations ¶
func ApplyMigrations(db *sql.DB, assetNames []string, assetGetter func(name string) ([]byte, error)) error
ApplyMigrations allows to apply bindata migrations on the current *sql.DB. `assetNames` is a list of assets with migrations and `assetGetter` is responsible for returning the content of the asset with a given name.
func Open ¶
func Open(path, key string, mc ...MigrationConfig) (*sql.DB, error)
Open opens or initializes a new database for a given file path. MigrationConfig is optional but if provided migrations are applied automatically.
func OpenWithIter ¶
OpenWithIter allows to open a new database with a custom number of kdf iterations. Higher kdf iterations number makes it slower to open the database.
Types ¶
Click to show internal directories.
Click to hide internal directories.