db

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MYSQL  = "mysql"
	SQLITE = "sqlite"
)

Variables

View Source
var ConfigDBError = &configDBError{}
View Source
var NoConfigDBError = &noConfigDBError{}

Functions

func InitDB

func InitDB(c config.IConfig) (*gorm.DB, error)

Types

type DB

type DB interface {
	Connection(cfg config.IConfig) (db *gorm.DB, err error)
}

type Mysql

type Mysql struct {
}

func (*Mysql) Connection

func (ms *Mysql) Connection(cfg config.IConfig) (db *gorm.DB, err error)

type MysqlConfig added in v0.1.1

type MysqlConfig struct {
	Dbname   string
	Database string
	Charset  string
	Username string
	User     string
	Password string
	Host     string
	Port     int
}

type MysqlConfigDBError

type MysqlConfigDBError struct {
}

func (*MysqlConfigDBError) Error

func (e *MysqlConfigDBError) Error() string

type SQLite

type SQLite struct {
}

func (*SQLite) Connection

func (sq *SQLite) Connection(cfg config.IConfig) (db *gorm.DB, err error)

type SQLiteConfig added in v0.1.2

type SQLiteConfig struct {
	FilePath string
}

Jump to

Keyboard shortcuts

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