gormx

package module
v0.0.0-...-88a4969 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

README

chassix-data-gorm

chassix data access with gorm for mysql、postgres etc.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseAllDB

func CloseAllDB() error

Close close all db connection

func DB

func DB() *gorm.DB

DB get the default(first) *Db connection

func DBs

func DBs() []*gorm.DB

DBs get all database connections

Types

type DatabaseConfig

type DatabaseConfig struct {
	Dialect     string `yaml:"dialect"`
	DSN         string `yaml:"dsn"`
	MaxIdle     int    `yaml:"max_idle"`
	MaxOpen     int    `yaml:"max_open"`
	MaxLifetime int    `yaml:"max_lifetime"`
	ShowSQL     bool   `yaml:"show_sql"`
}

DatabaseConfig db datasource

type Datasource

type Datasource struct {
	Databases []*DatabaseConfig `yaml:"databases,flow"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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