db

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearConnector added in v0.2.21

func ClearConnector()

func Init added in v0.2.21

func Init(dbType string, dsn string, tlsConfig *tls.TLSConfig) error

func SetDB added in v0.3.2

func SetDB(connectedDB *gorm.DB)

Types

type ConnectedConnector added in v0.3.2

type ConnectedConnector struct {
	ConnectedDB *gorm.DB
}

ConnectedConnector satifies the connector interface for an already connected gorm.DB instance.

func (ConnectedConnector) Connect added in v0.3.2

func (c ConnectedConnector) Connect() (*gorm.DB, error)

func (ConnectedConnector) DB added in v0.3.2

func (c ConnectedConnector) DB() *gorm.DB

type Connector

type Connector interface {
	Connect() (*gorm.DB, error)
	DB() *gorm.DB
}

func GetConnector added in v0.2.21

func GetConnector() (Connector, bool)

type DBMigrator

type DBMigrator interface {
	Migrate() error
	Up(steps *int) error
	Down(steps *int) error
}

func NewDBMigrator

func NewDBMigrator(db *gorm.DB) (DBMigrator, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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