protoseaql

package
v0.12.10 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Identity                  = "seaql"
	Attribute_Name_Name       = "name"
	Attribute_Name_Engine     = "engine"
	Attribute_Name_Charset    = "charset"
	Attribute_Name_Collate    = "collate"
	Attribute_Name_Index      = "index"
	Attribute_Name_ForeignKey = "foreign_key"
	Attribute_Name_Type       = "type"
)

annotation const value

Variables

This section is empty.

Functions

func Execute

func Execute(w io.Writer, data *Schema) error

Types

type Column

type Column struct {
	Name    string // 列名
	Type    string // sql 定义
	Comment string // 注释
}

type Schema

type Schema struct {
	Tables []Table // 表
}

type SeaqlDerive added in v0.12.2

type SeaqlDerive struct {
	Enabled     bool
	Name        string   // 表名
	Comment     string   // 注释
	Engine      string   // 引擎
	Charset     string   // 字符集
	Collate     string   // 排序规则
	Indexes     []string // 索引
	ForeignKeys []string // 外键
}

func ParseSeaqlDerive added in v0.12.2

func ParseSeaqlDerive(rawTableName string, s protogen.Comments) *SeaqlDerive

type SeaqlValueDerive added in v0.12.2

type SeaqlValueDerive struct {
	Type string
}

func ParseSeaqlValueDerive added in v0.12.2

func ParseSeaqlValueDerive(s protogen.Comments) (*SeaqlValueDerive, protoutil.CommentLines)

type Table

type Table struct {
	Name        string   // 表名
	Comment     string   // 注释
	Engine      string   // 引擎
	Charset     string   // 字符集
	Collate     string   // 排序规则
	Indexes     []string // 索引
	ForeignKeys []string // 外键
	Columns     []Column // 列项
}

func IntoTable

func IntoTable(protoMessages []*protogen.Message) ([]Table, error)

IntoTable generates the errors definitions, excluding the package statement.

Jump to

Keyboard shortcuts

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