dbManager

package
Version: v0.0.0-...-312110e Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2021 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DEFAULT_DB_NAME = "main"
View Source
var DbMap = map[string]*ORM{}

Functions

func SetDb

func SetDb(name string, orm *ORM)

Types

type ConfigPostgresql

type ConfigPostgresql struct {
	DSN string // orm DSN

}

type ConfigSqlite

type ConfigSqlite struct {
	Path string
}

type ORM

type ORM struct {
	DB *gorm.DB
	// contains filtered or unexported fields
}

func GetDb

func GetDb(name string) (orm *ORM)

func New

func New(c *OrmConfig) *ORM

func NewPostgresql

func NewPostgresql(c *ConfigPostgresql) *ORM

func NewSqlite

func NewSqlite(c *ConfigSqlite) *ORM

type OrmConfig

type OrmConfig struct {
	DbType     string
	Sqlite     ConfigSqlite
	Postgresql ConfigPostgresql
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL