datastore

package
v0.0.0-...-0a38112 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close(db *gorm.DB)

func CreateMigrationFile

func CreateMigrationFile(migrationName string) error

From hmscontent

func DBMigrationPath

func DBMigrationPath() string

func MigrateDb

func MigrateDb(cfg *config.Config, direction string, steps ...int) error

func MigrateDown

func MigrateDown(config *config.Config, steps ...int) error

func MigrateUp

func MigrateUp(config *config.Config, steps ...int) error

func NewDB

func NewDB(cfg *config.Config, sl *slog.Logger) (db *gorm.DB)

NewDB return a new gorm database connector. cfg provides the database connection information. return a gorm.DB instance if success, nil on error and panic on invalid input arguments.

func NewDbMigration

func NewDbMigration(config *config.Config) (m *migrate.Migrate, err error)

func SetDBMigrationPath

func SetDBMigrationPath(value string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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