table

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	UseGormTag bool
	UseJsonTag bool
	SortField  bool   // sort field
	PkgName    string // output file package name
}

func (*Config) Build

func (c *Config) Build() *Table

type Field added in v0.2.1

type Field struct {
	Name          string
	RawName       string
	Default       defaultValue
	TypeName      string
	RawTypeName   string
	Comment       string
	AutoIncrement bool
	Unsigned      bool
	NotNull       bool

	Type *Type
	// contains filtered or unexported fields
}

type Index

type Index struct {
	Fields  []string
	Type    int
	RawName string
	Comment string
}

type Table

type Table struct {
	Config

	Name        string
	RawName     string
	Fields      []*Field
	PrimaryKeys []string
	Indexes     []*Index

	Imports map[string]string
	Comment string
	// contains filtered or unexported fields
}

func (*Table) Data

func (t *Table) Data() []byte

func (*Table) Format

func (t *Table) Format()

func (*Table) Marshal

func (t *Table) Marshal()

func (*Table) Parse

func (t *Table) Parse(data []byte)

type Type

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

func (*Type) String

func (t *Type) String() string

Jump to

Keyboard shortcuts

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