db

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DB_MYSQL  = "mysql"
	DB_SQLITE = "sqlite"
)

Variables

This section is empty.

Functions

func GetOrm

func GetOrm() *gorm.DB

func Init

func Init(dbType, dsn, file string) (err error)

Types

type Database

type Database interface {
	Name() string
	String() string
	Init() (*gorm.DB, error)
}

func NewMySQL

func NewMySQL(dsn string) Database

NewMySQL returns an instance of mysql

func NewSQLite

func NewSQLite(file string) Database

NewSQLite returns an instance of sqlite

Jump to

Keyboard shortcuts

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