dbfactroy

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MulanPSL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DbConfig

type DbConfig struct {
	DbType string
	DbName string

	Host     string
	Port     int32
	User     string
	Password string
}

@Title 文件名称: db_config.go @Description 描述: 代码工厂数据库配置信息

@Author 作者: leijianming@163.com 时间(2024-01-31 22:38:21) @Update 作者: leijianming@163.com 时间(2024-01-31 22:38:21)

func (*DbConfig) LogInfo

func (dbConfig *DbConfig) LogInfo() (dburl string)

func (*DbConfig) MakeDbUrl

func (dbConfig *DbConfig) MakeDbUrl() (dburl string)

DbUrl: "host=192.168.13.235 port=26257 user=code password=123456 dbname=" + base.Module.DbName + " sslmode=require",

func (*DbConfig) MakeDbUrlMysql

func (dbConfig *DbConfig) MakeDbUrlMysql() (dburl string)

func (*DbConfig) MakeDbUrlPostgres

func (dbConfig *DbConfig) MakeDbUrlPostgres() (dburl string)

func (*DbConfig) MakeDbUrlPostgresSsl

func (dbConfig *DbConfig) MakeDbUrlPostgresSsl() (dburl string)

func (*DbConfig) MakeDbUrlSsl

func (dbConfig *DbConfig) MakeDbUrlSsl() (dburl string)

type DbFactroy

type DbFactroy struct {
	Author       string //作者
	DbConfig     *DbConfig
	ModuleDefine common.ModuleDefine

	DbType       string
	DbName       string  //数据库名
	Table        string  //表名
	TableComment *string //ModelNameWithTable bool

	Pkey     string
	PkeyType string

	Tables []string //genTables list

	GenDir     string
	GenDirTest string

	// tmp member var
	TestFiles       []string `json:"-"`
	StringFieldName string   `json:"-"`
	StringFieldLen  string   `json:"-"`

	AllTables []metadata.Tables   `json:"-"` //genTables all for CheckTableExist
	DirFileCS []metadata.DirFileC `json:"-"` //dir service content

	DbUrl string
	I     int `json:"-"`
}

@Title 文件名称: db_factroy.go @Description 描述: 代码工厂基础数据库工厂

@Author 作者: leijianming@163.com 时间(2024-01-31 22:38:21) @Update 作者: leijianming@163.com 时间(2024-01-31 22:38:21)

func (*DbFactroy) BuildInfo

func (dbFactroy *DbFactroy) BuildInfo(gendir string)

func (*DbFactroy) BuildInfoTest

func (dbFactroy *DbFactroy) BuildInfoTest(gendir string)

func (*DbFactroy) BuildModel

func (dbFactroy *DbFactroy) BuildModel() (cs *[]metadata.Columns, ms *list.List, ps *list.List, msdto *list.List)

func (*DbFactroy) CheckTableExist

func (dbFactroy *DbFactroy) CheckTableExist() bool

func (*DbFactroy) FindColumns

func (dbFactroy *DbFactroy) FindColumns() *[]metadata.Columns

func (*DbFactroy) FindGoType

func (dbFactroy *DbFactroy) FindGoType(fieldType string) (goType string)

func (*DbFactroy) FindPgPkey

func (dbFactroy *DbFactroy) FindPgPkey(table string) []metadata.PkInfo

func (*DbFactroy) FindProtoType

func (dbFactroy *DbFactroy) FindProtoType(fieldType string) (pbType string)

func (*DbFactroy) FindTableComment

func (dbFactroy *DbFactroy) FindTableComment()

func (*DbFactroy) FindTables

func (dbFactroy *DbFactroy) FindTables() []metadata.Tables

func (*DbFactroy) Ini

func (dbFactroy *DbFactroy) Ini() (dbinst *gorm.DB)

func (*DbFactroy) IniDb

func (dbFactroy *DbFactroy) IniDb(conn string) (dbinst *gorm.DB)

func (*DbFactroy) IniLog

func (dbFactroy *DbFactroy) IniLog() *DbFactroy

func (*DbFactroy) IsMysql

func (dbFactroy *DbFactroy) IsMysql() bool
func (dbFactroy *DbFactroy) IniJoinQuery(tables string) (query *gofactroy.JoinQuery) {
	query = &gofactroy.JoinQuery{}
	query.Ini(dbFactroy, tables)
	return
}

func (*DbFactroy) MakeModelProto

func (dbFactroy *DbFactroy) MakeModelProto() *list.List

func (*DbFactroy) MakeModelProtoBody

func (dbFactroy *DbFactroy) MakeModelProtoBody(columns *[]metadata.Columns) *list.List

func (*DbFactroy) Println

func (dbFactroy *DbFactroy) Println()

func (*DbFactroy) SendEmail

func (dbFactroy *DbFactroy) SendEmail(subj, msg string)

func (*DbFactroy) String

func (tmp *DbFactroy) String() string

func (*DbFactroy) ToString

func (tmp *DbFactroy) ToString() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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