schema

package
v0.0.0-...-3c93513 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: Apache-2.0 Imports: 5 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 {
	Name   string
	Tag    string
	Column string
}

Field represents a column of database

type ITableName

type ITableName interface {
	TableName() string
}

type Schema

type Schema struct {
	Model      interface{}
	Name       string
	Fields     []*Field // 结构中的field
	FieldNames []string // sql 中的field

	SubTableFile string
	Auto         string
	// contains filtered or unexported fields
}

Schema represents a table of database

func Parse

func Parse(dbSchema string, split map[string]spliter.Split, dest interface{}) *Schema

Parse a struct to a Schema instance

func ParseTable

func ParseTable(table string) *Schema

func (*Schema) GetField

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

GetField returns field by name

func (*Schema) RecordValuesCustom

func (schema *Schema) RecordValuesCustom(val reflect.Value, dest interface{}, selectField []string, omitField []string) []interface{}

Jump to

Keyboard shortcuts

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