generates

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2020 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(out string, jsonTag bool, tables []*entry.Table, queries []*entry.Query) (err error)

Types

type GenerateFile

type GenerateFile struct {
	Name    string
	Content []byte
}

type GenerateQueryData

type GenerateQueryData struct {
	Exec          bool
	RawName       string
	Package       string
	Imports       map[string]string
	LowName       string
	Name          string
	QuerySQL      string
	RequestFields []*QueryField
	IsTable       bool
	Table         *entry.Table
	ResultFields  []*QueryField
}

type GenerateTableData

type GenerateTableData struct {
	RawName       string
	Package       string
	Imports       map[string]string
	LowName       string
	Name          string
	GetSQL        string
	InsertSQL     string
	UpdateSQL     string
	DeleteSQL     string
	HasAutoIncrId bool
	Fields        []*TableField
}

type QueryField

type QueryField struct {
	Name       string
	Type       string
	Tags       string
	Replaced   bool
	ReplaceKey string
}

type TableField

type TableField struct {
	Pk       bool
	AutoIncr bool
	Name     string
	Type     string
	Tags     string
}

type TemplateData

type TemplateData struct {
	Package string
	Imports map[string]string
}

Jump to

Keyboard shortcuts

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