database

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultDatabaseName = "default"

Variables

View Source
var ErrRecordNotFound = gorm.ErrRecordNotFound

Functions

This section is empty.

Types

type Config

type Config struct {
	Connections map[string]ConnectionConfig
}

type ConnectionConfig

type ConnectionConfig struct {
	Driver   string
	User     string
	Password string
	Host     string
	Port     string
	Database string
}

type Database

type Database = gorm.DB

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(cfg Config) (*Service, error)

func (*Service) GetDatabase

func (m *Service) GetDatabase(name string) *Database

func (*Service) GetDefault

func (m *Service) GetDefault() *Database

Jump to

Keyboard shortcuts

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