database

package
v0.0.0-...-66cf1cd Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package database @program: gin-template @author: [lliuhuan](https://github.com/lliuhuan) @create: 2024-07-03 10:14

Package database

@program:	gin-template
@author:	[lliuhuan](https://github.com/lliuhuan)
@create:	2024-07-03 10:19

Index

Constants

This section is empty.

Variables

View Source
var (
	EqualPredicate              = Predicate("=")
	NotEqualPredicate           = Predicate("<>")
	GreaterThanPredicate        = Predicate(">")
	GreaterThanOrEqualPredicate = Predicate(">=")
	SmallerThanPredicate        = Predicate("<")
	SmallerThanOrEqualPredicate = Predicate("<=")
	LikePredicate               = Predicate("LIKE")
)

Functions

func GetMySQLClient

func GetMySQLClient() (*gorm.DB, error)

func GetPostgreSqlClient

func GetPostgreSqlClient() (*gorm.DB, error)

func GetSqlServerClient

func GetSqlServerClient() (*gorm.DB, error)

Types

type Predicate

type Predicate string

Predicate is a string that acts as a condition in the where clause

type Repo

type Repo interface {
	GetDB() *gorm.DB
	DBClose() error
	// contains filtered or unexported methods
}

func New

func New() (Repo, error)

New 创建一个DB对象

type TracePlugin

type TracePlugin struct{}

func (*TracePlugin) Initialize

func (op *TracePlugin) Initialize(db *gorm.DB) (err error)

func (*TracePlugin) Name

func (op *TracePlugin) Name() string

Directories

Path Synopsis
Package cron_task @program: gin-template @author: [lliuhuan](https://github.com/lliuhuan) @create: 2024-07-03 15:26
Package cron_task @program: gin-template @author: [lliuhuan](https://github.com/lliuhuan) @create: 2024-07-03 15:26

Jump to

Keyboard shortcuts

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