database

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2025 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LogFieldSQL        = log.Path{Identifier: "sql"}
	LogFieldSQLRequest = log.Path{Parent: &LogFieldSQL, Identifier: "request"}

	LogFieldSQLRowsAffected = log.Path{Parent: &LogFieldSQLRequest, Identifier: "rows_affected"}
	LogFieldSQLQuery        = log.Path{Parent: &LogFieldSQLRequest, Identifier: "query"}

	LogScopeTime        = log.Path{Parent: &LogFieldSQLRequest, Identifier: "time"}
	LogFieldTimeStarted = log.Path{Parent: &LogScopeTime, Identifier: "started"}
	LogFieldTimeEnded   = log.Path{Parent: &LogScopeTime, Identifier: "ended"}
	LogFieldDuration    = log.Path{Parent: &LogScopeTime, Identifier: "duration_ms"}
)

Functions

This section is empty.

Types

type Database

type Database struct {
	DB *gorm.DB
	// contains filtered or unexported fields
}

func NewPostgresDatabase

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

func (*Database) RegisterModels

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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