db

package
v0.0.62 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const USER_DEFAULT_PRIVILEGES = "CREATE, CREATE VIEW, CREATE TEMPORARY TABLES, SELECT, INSERT, UPDATE, DELETE, EXECUTE, LOCK TABLES, TRIGGER"

Variables

View Source
var MAX_IDLE_CONNS = 0
View Source
var MAX_OPEN_CONNS = 500

Functions

This section is empty.

Types

type Db

type Db struct {
	// contains filtered or unexported fields
}

func NewDb

func NewDb() *Db

func (*Db) AddDb

func (db *Db) AddDb(dbconf *DbConfig, passwdGet ...PasswordDecode)

func (*Db) CreateDb

func (db *Db) CreateDb(dbname string, collate string) bool

func (*Db) CreateUser

func (db *Db) CreateUser(username string, hostname string, passwd string) bool

func (*Db) GrantUserPrivileges

func (db *Db) GrantUserPrivileges(dbname string, username string, hostname string) bool

func (*Db) SizeDb

func (db *Db) SizeDb(dbname string) float32

func (*Db) SizeTable added in v0.0.52

func (db *Db) SizeTable(dbname string) []TableSize

type DbConfig

type DbConfig struct {
	// contains filtered or unexported fields
}

func NewDbConfig added in v0.0.6

func NewDbConfig(host string, dbname string, user string, passwd string, port int) *DbConfig

func (*DbConfig) GetHost

func (dbc *DbConfig) GetHost() string

func (*DbConfig) GetSqlConfig

func (dbc *DbConfig) GetSqlConfig(passwdGet ...PasswordDecode) *mysql.Config

type DbInstruct

type DbInstruct func(database *sql.DB) bool

type PasswordDecode

type PasswordDecode func(in string) (string, bool)

type TableSize added in v0.0.52

type TableSize struct {
	Table string
	Size  float32
}

Jump to

Keyboard shortcuts

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