dbManager

package
v0.0.0-...-d8cc314 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 License: GPL-3.0 Imports: 7 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
y or Y : Canonical URL