sql2struct

package
v0.0.0-...-d77992a Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package sql2struct ... @Time : 2020/1/3 13:58 @Software: GoLand @File : init @Author : https://github.com/hsyan2008/gom

Package sql2struct ... @Time : 2020/1/7 11:04 @Software: GoLand @File : xorm_tag @Author : Bingo <airplayx@gmail.com>

Index

Constants

This section is empty.

Variables

View Source
var Engine *xorm.Engine

Engine ...

Functions

func GetGormTag

func GetGormTag(table *schemas.Table, col *schemas.Column) string

GetGormTag ...

func GetJSONTag

func GetJSONTag(column *schemas.Column, isOmitempty bool) string

GetJSONTag ...

func GetXormTag

func GetXormTag(table *schemas.Table, col *schemas.Column) string

GetXormTag ...

func Init

func Init(db *SourceMap) (err error)

Init ...

func RmDuplicateElement

func RmDuplicateElement(keywords []string) []string

RmDuplicateElement ...

Types

type GenTool

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

GenTool ...

func NewGenTool

func NewGenTool() *GenTool

NewGenTool ...

func (*GenTool) Gen

func (genTool *GenTool) Gen(table *schemas.Table, dbConf *SourceMap) (result []byte, err error)

Gen ...

type Model

type Model struct {
	StructName string
	TableName  string
	Imports    map[string]string
	Fields     []ModelField
	Comment    string
}

Model ...

type ModelField

type ModelField struct {
	FieldName  string
	ColumnName string
	Type       string
	Imports    map[string]string
	Tag        string
	Comment    string
}

ModelField ...

func NewModelField

func NewModelField(table *schemas.Table, column *schemas.Column, maps string) (f *ModelField)

NewModelField ...

type SQL2Struct

type SQL2Struct struct {
	AutoSave      bool        `json:"auto_save"`
	JSONOmitempty bool        `json:"json_omitempty"`
	Reflect       string      `json:"reflect"`
	SourceMap     []SourceMap `json:"sourceMap"`
	Special       string      `json:"special"`
	Tags          []string    `json:"tags"`
	TargetDir     string      `json:"target_dir"`
	Tinyint2bool  bool        `json:"tinyint2bool"`
}

SQL2Struct ...

func Configs

func Configs() (s2s *SQL2Struct)

Configs ...

type SourceMap

type SourceMap struct {
	Db       []string `json:"db"`
	Driver   string   `json:"driver"`
	Host     string   `json:"host"`
	Password string   `json:"password"`
	Port     string   `json:"port"`
	User     string   `json:"user"`
}

SourceMap ...

Directories

Path Synopsis
Package sqlorm ...
Package sqlorm ...
util
Package util ...
Package util ...

Jump to

Keyboard shortcuts

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