database

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const Mysql = "mysql"
View Source
const Postgres = "postgres"
View Source
const Sqlite = "sqlite"
View Source
const UnknownDatabase = "unknown database"

Variables

View Source
var (
	DB     *gorm.DB
	Driver DriverType
	Locker sync.Mutex
)

Functions

func InitDB

func InitDB(dsn string) (err error)

func NewMysql added in v0.3.0

func NewMysql(dsn string) (*gorm.DB, error)

func NewPostgres added in v0.4.0

func NewPostgres(dsn string) (*gorm.DB, error)

func NewSqlite3

func NewSqlite3(dsn string) (*gorm.DB, error)

Types

type DriverType added in v0.2.1

type DriverType = string

type ListField

type ListField []string

func (*ListField) Scan

func (f *ListField) Scan(data interface{}) error

func (ListField) Value

func (f ListField) Value() (driver.Value, error)

type MapField

type MapField map[string]string

func (*MapField) Scan

func (f *MapField) Scan(data interface{}) error

func (MapField) Value

func (f MapField) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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