database

package module
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2025 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDatabaseFromContext added in v0.2.2

func GetDatabaseFromContext(ctx context.Context) (*gorm.DB, error)

Types

type Database

type Database struct {
	Gorm *gorm.DB
}

func NewPostgresDatabase

func NewPostgresDatabase(config *domain.PostgresConfig) (*Database, error)

func (*Database) RegisterModels

func (d *Database) RegisterModels(models ...interface{}) error

type SQLEntryMetric added in v0.2.3

type SQLEntryMetric struct {
	Query        string `metric:"query"`
	AffectedRows int64  `metric:"affected_rows"`
	Duration     int64  `metric:"duration"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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