gormpgsql

package
v0.0.0-...-e68bd62 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrate

func Migrate(gorm *gorm.DB, types ...interface{}) error

func NewGenericRepository

func NewGenericRepository[T any](db *gorm.DB) *genericRepository[T]

create new gorm generic repository

func NewGorm

func NewGorm(config *GormPostgresConfig) (*gorm.DB, error)

Types

type Gorm

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

func (*Gorm) Close

func (db *Gorm) Close()

type GormPostgresConfig

type GormPostgresConfig struct {
	Host     string `mapstructure:"host"`
	Port     int    `mapstructure:"port"`
	User     string `mapstructure:"user"`
	DBName   string `mapstructure:"dbName"`
	SSLMode  bool   `mapstructure:"sslMode"`
	Password string `mapstructure:"password"`
}

Jump to

Keyboard shortcuts

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