orm

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

View Source
const (
	KeyInitDB      = ginshared.KeyInitDB
	KeyTablePrefix = "database.tablePrefix"
)
View Source
const (
	HealthURIKey   = "healthz"
	HealthURIValue = "/healthz"
)
View Source
const ViewMysqlTmp = "CREATE OR REPLACE ALGORITHM = UNDEFINED VIEW %s%s AS %s"

Variables

View Source
var DialectorMap = make(map[string]OrmDialector)

Functions

func InitDB

func InitDB(sub string, logger *zap.Logger) *gorm.DB

func InitDefaultDB added in v0.1.3

func InitDefaultDB(logger *zap.Logger) *gorm.DB

func InitMysqlViews added in v0.1.7

func InitMysqlViews(tx *gorm.DB, logger *zap.Logger) error

Types

type DBCronJob added in v0.1.8

type DBCronJob struct {
	Name     string
	Schedule string
	Sql      string
	// contains filtered or unexported fields
}

func (*DBCronJob) FireJob added in v0.1.8

func (job *DBCronJob) FireJob()

type HealthController

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

func (*HealthController) Ping

func (h *HealthController) Ping(c *gin.Context)

type OrmDialector added in v0.0.5

type OrmDialector func(dsn string) gorm.Dialector

type RawQuery added in v0.1.10

type RawQuery struct {
	Sql    string
	Preset map[string]interface{}
	Params []string
}

func (*RawQuery) Query added in v0.2.0

func (r *RawQuery) Query(db *gorm.DB, data map[string]interface{}) ([]map[string]interface{}, error)

type RawQuerySerice added in v0.1.11

type RawQuerySerice struct {
	EnabledAuth bool
	Base        string
	Items       []SerivceItem
	// contains filtered or unexported fields
}

type SerivceItem added in v0.2.0

type SerivceItem struct {
	Uri   string
	Query RawQuery
}

Jump to

Keyboard shortcuts

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