database

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(ctx context.Context) *gorm.DB

func Open

func Open(c Config) (*gorm.DB, error)

func Set

func Set(ctx context.Context, tx *gorm.DB) context.Context

func SetMiddleware

func SetMiddleware(tx *gorm.DB) func(http.Handler) http.Handler

Types

type Config

type Config struct {
	Type  DBType
	Dsn   string
	Debug bool
}

type DBType

type DBType string
const (
	SQLite DBType = "sqlite"
	MySQL  DBType = "mysql"
)

Jump to

Keyboard shortcuts

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