schema

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	Label        string
	Name         string
	Column       string
	Type         string
	Enum         []string
	Comment      string
	Default      string
	IsDefaultRaw bool
	IsPrimaryKey bool
	NotNull      bool
	Index        string
	Unique       string
	Length       uint
	Precision    uint
	Scale        uint
}

type Schema

type Schema struct {
	Definition string
	Name       string
	TableName  string
	Comment    string
	Fields     []*Field
	FieldNames []string
	// contains filtered or unexported fields
}

func Parse

func Parse(definition string) *Schema

Parse 将定义的模型json转为schema

func (*Schema) GetField

func (schema *Schema) GetField(name string) *Field

func (*Schema) RecordValues

func (schema *Schema) RecordValues(dest map[string]interface{}) []interface{}

RecordValues 获取按照模型字段顺序排列的字段数据

Jump to

Keyboard shortcuts

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