orm

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine added in v1.1.0

type Engine struct {
	*gorm.DB
	Mode string
}

type IEngine

type IEngine interface {
	DSN() gorm.Dialector
	Mode() string
}

type Instance

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

func NewInstance

func NewInstance(option ...Option) *Instance

func (*Instance) GetEngine

func (this *Instance) GetEngine() *Engine

type Mysql

type Mysql struct {
	Address, Username, Password string
	Database, Parameters        string
}

func (*Mysql) DSN

func (this *Mysql) DSN() gorm.Dialector

func (*Mysql) Mode added in v1.1.0

func (this *Mysql) Mode() string

type Option

type Option func(instance *Instance)

func WithMaxIdleConns

func WithMaxIdleConns(maxIdleConns int) Option

func WithMaxLifetime

func WithMaxLifetime(maxLifetime int) Option

func WithMaxOpenConns

func WithMaxOpenConns(maxOpenConns int) Option

func WithSingularTable

func WithSingularTable(singularTable bool) Option

func WithTablePrefix

func WithTablePrefix(tablePrefix string) Option

type Sqlite

type Sqlite struct {
	Path, Name string
}

func (*Sqlite) DSN

func (this *Sqlite) DSN() gorm.Dialector

func (*Sqlite) Mode added in v1.1.0

func (this *Sqlite) Mode() string

Jump to

Keyboard shortcuts

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