db

package
v0.0.0-...-3cadddf Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Open

func Open(conf *Config) *gorm.DB

Open generate a database client

Types

type Config

type Config struct {
	User        string `json:"user"`
	Password    string `json:"password"`
	Host        string `json:"host"`
	Port        string `json:"port"`
	Name        string `json:"name"`
	Charset     string `json:"charset"`
	TablePrefix string `json:"tablePrefix"`
}

Database option for configurations

type Database

type Database struct {
	*gorm.DB
}

Database is wrapped struct of *sql.DB

func NewDatabase

func NewDatabase(conf *Config) *Database

NewDatabase waper gorm.DB

Jump to

Keyboard shortcuts

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