postgres

package
v0.0.0-...-711557a Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoMigrate

func AutoMigrate(db *gorm.DB, models ...interface{}) error

AutoMigrate automatically migrates the schema for the given models

func CloseConnection

func CloseConnection(db *gorm.DB) error

CloseConnection closes the database connection

func NewApplicationRepository

func NewApplicationRepository(db *gorm.DB) repository.ApplicationRepository

func NewClientRepository

func NewClientRepository(db *gorm.DB) repository.ClientRepository

func NewConnection

func NewConnection(config *Config) (*gorm.DB, error)

NewConnection establishes a new database connection using GORM

func NewLicenseRepository

func NewLicenseRepository(db *gorm.DB) repository.LicenseRepository

func NewLicenseTypeRepository

func NewLicenseTypeRepository(db *gorm.DB) repository.LicenseTypeRepository

func RollbackMigrations

func RollbackMigrations(db *gorm.DB, migrationsPath string) error

RollbackMigrations rolls back the last applied migration

func RunMigrations

func RunMigrations(db *gorm.DB, migrationsPath string) error

RunMigrations executes database migrations

Types

type Config

type Config struct {
	Host     string
	Port     int
	User     string
	Password string
	DBName   string
	SSLMode  string
}

Config holds the database configuration

Jump to

Keyboard shortcuts

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