database

package
v0.0.0-...-a5319db Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDatabaseDriverMismatch = errors.New("database driver mismatch")

Functions

func Columns

func Columns(table interface{}) []string

func DbResolveAddress

func DbResolveAddress(ctx context.Context, logger *zap.Logger, host string) ([]string, map[string]struct{})

func GetOid

func GetOid(name string) uint32

func UseGormLoggerLevel

func UseGormLoggerLevel(level string) logger.LogLevel

Types

type Config

type Config interface {
	Valid() error
}

type ModelUUIDV1

type ModelUUIDV1 struct {
	ID        uuid.UUID `gorm:"primarykey"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
}

type ModelUUIDV2

type ModelUUIDV2 struct {
	ID        uuid.UUID `gorm:"primarykey"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
	Version   uint           `json:"-" gorm:"version"`
}

type ModelV1

type ModelV1 struct {
	ID        uint `gorm:"primarykey"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
}

type ModelV2

type ModelV2 struct {
	ID        uint `gorm:"primarykey"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
	Version   uint           `json:"-" gorm:"version"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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